當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.ACTION_SENDTO屬性代碼示例

本文整理匯總了Java中android.content.Intent.ACTION_SENDTO屬性的典型用法代碼示例。如果您正苦於以下問題:Java Intent.ACTION_SENDTO屬性的具體用法?Java Intent.ACTION_SENDTO怎麽用?Java Intent.ACTION_SENDTO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_SENDTO屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onNoDoubleClick

@Override
protected void onNoDoubleClick(View v) {
    switch (v.getId()) {
        case R.id.tv_issues:
            WebViewActivity.loadUrl(v.getContext(),CommonUtils.getString(R.string.string_url_issues),"Issues");
            break;
        case R.id.tv_qq:
            String url = "mqqwpa://im/chat?chat_type=wpa&uin=544351900";
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
            break;
        case R.id.tv_email:
            Intent data = new Intent(Intent.ACTION_SENDTO);
            data.setData(Uri.parse("[email protected]"));
            startActivity(data);
            break;
        case R.id.tv_jianshu:
            WebViewActivity.loadUrl(v.getContext(),"http://www.crazyjoe.cn","加載中...");
            break;
        case R.id.tv_faq:
            WebViewActivity.loadUrl(v.getContext(),string_url_faq,"常見問題歸納");
            break;
    }
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:23,代碼來源:NavDeedBackActivity.java

示例2: sendMsg

/**
 * 發送消息
 * @param String phone
 */
private void sendMsg(String phone){
	Uri smsToUri = Uri.parse("smsto:" + phone);
	Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri);
	int resId = ResHelper.getStringRes(activity, "smssdk_invite_content");
	if (resId > 0) {
		intent.putExtra("sms_body", activity.getString(resId));
	}
	if (intent.resolveActivity(this.getContext().getPackageManager()) != null) {
		startActivity(intent);
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:ContactDetailPage.java

示例3: sendSMSFromUri

final void sendSMSFromUri(String uri, String body) {
  Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
  putExtra(intent, "sms_body", body);
  // Exit the app once the SMS is sent
  intent.putExtra("compose_mode", true);
  launchIntent(intent);
}
 
開發者ID:yun2win,項目名稱:tvConnect_android,代碼行數:7,代碼來源:ResultHandler.java

示例4: submitOrder

/**
 * This method is called when the order button is clicked.
 */
public void submitOrder(View view) {
    // Get user's name
    EditText nameField = (EditText) findViewById(R.id.name_field);
    Editable nameEditable = nameField.getText();
    String name = nameEditable.toString();

    // Figure out if the user wants whipped cream topping
    CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);
    boolean hasWhippedCream = whippedCreamCheckBox.isChecked();

    // Figure out if the user wants choclate topping
    CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.chocolate_checkbox);
    boolean hasChocolate = chocolateCheckBox.isChecked();

    // Calculate the price
    int price = calculatePrice(hasWhippedCream, hasChocolate);

    // Display the order summary on the screen
    String message = createOrderSummary(name, price, hasWhippedCream, hasChocolate);

    // Use an intent to launch an email app.
    // Send the order summary in the email body.
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:")); // only email apps should handle this
    intent.putExtra(Intent.EXTRA_SUBJECT,
            getString(R.string.order_summary_email_subject, name));
    intent.putExtra(Intent.EXTRA_TEXT, message);

    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
 
開發者ID:ItalianCoder,項目名稱:Google-Developer-Challenge-Scholarship-Android-Basics,代碼行數:35,代碼來源:MainActivity.java

示例5: onClick

/**
 * Gestiona el evento en los botones click
 *
 * @param view vista que origina l'event
 */
@Override
public void onClick(View view) {
    Hashtable<String, String> params;
    // procesamos el evento en función del origen del evento.
    switch (view.getId()) {
        case R.id.btnBrowser:
            openIntent(Intent.ACTION_VIEW, "http://www.google.com");
            break;
        case R.id.btnTexto:
            params = new Hashtable<>();
            params.put(Intent.EXTRA_TEXT, getString(R.string.textoEjemplo));
            openIntent(Intent.ACTION_SEND, "text/plain", params);
            break;
        case R.id.btnLLamada:
            openIntent(Intent.ACTION_DIAL, "tel:5551234");
            break;
        case R.id.btnEmail:
            Intent intent = new Intent(Intent.ACTION_SENDTO);
            intent.setType("text/plain");
            intent.setData(Uri.parse("mailto:[email protected]"));
            intent.putExtra(Intent.EXTRA_SUBJECT, "asunto de prueba");
            intent.putExtra(Intent.EXTRA_TEXT, "probando el envio");
            intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
            startActivity(intent);
            break;
        case R.id.btnFoto:
            getPicture();
            break;
    }
}
 
開發者ID:gothalo,項目名稱:Android-2017,代碼行數:35,代碼來源:MainActivity.java

示例6: getSendSmsIntent

/**
 * 獲取跳至發送短信界麵的意圖
 *
 * @param phoneNumber 接收號碼
 * @param content     短信內容
 */
public static Intent getSendSmsIntent(String phoneNumber, String content) {
    Uri uri = Uri.parse("smsto:" + phoneNumber);
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    intent.putExtra("sms_body", content);
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
開發者ID:pan2yong22,項目名稱:AndroidUtilCode-master,代碼行數:12,代碼來源:IntentUtils.java

示例7: sendEmail

public Intent sendEmail (String email, String subject, String message) {
	Intent intent = new Intent(Intent.ACTION_SENDTO);
	intent.setData(Uri.parse("mailto:")); // only email apps should handle this
	intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
	intent.putExtra(Intent.EXTRA_SUBJECT, subject);
	intent.putExtra(Intent.EXTRA_TEXT, message);
	
	return intent;
}
 
開發者ID:jrvansuita,項目名稱:MaterialAbout,代碼行數:9,代碼來源:IntentUtil.java

示例8: phoneMessageByIntent

public static void phoneMessageByIntent(Activity activity, String phone_number) {
    Intent sendIntent = new Intent(Intent.ACTION_SENDTO);
    sendIntent.setData(Uri.parse("smsto:" + phone_number));
    if (sendIntent.resolveActivity(activity.getPackageManager()) != null) {
        activity.startActivity(sendIntent);
    }
}
 
開發者ID:nhocga1995s,項目名稱:MyCalendar,代碼行數:7,代碼來源:FunctionHelper.java

示例9: feedbackToEmail

private void feedbackToEmail() {
    Intent data = new Intent(Intent.ACTION_SENDTO);
    data.setData(Uri.parse("mailto:[email protected]"));
    data.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.send_email_subject));
    data.putExtra(Intent.EXTRA_TEXT, "----------\n" + getString(R.string.send_email_app_name) + getString(R.string.app_name)
            + getString(R.string.send_email_app_version) + CommonUtil.getAppVersion(AboutActivity.this)
            + getString(R.string.send_email_phone_model) + CommonUtil.getPhoneModel()
            + getString(R.string.android_version) + CommonUtil.getAndroidVersion()
            + "\n----------"
            + getString(R.string.leave_feedback));
    startActivity(Intent.createChooser(data, getString(R.string.choose_email_app)));
}
 
開發者ID:XYScience,項目名稱:StopApp,代碼行數:12,代碼來源:AboutActivity.java

示例10: sendSms

/**
 * 發送短信
 */
public static void sendSms(Context context, String phoneNumber, String content) {
    Uri uri = Uri.parse("smsto:" + (TextUtils.isEmpty(phoneNumber) ? "" : phoneNumber));
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    intent.putExtra("sms_body", TextUtils.isEmpty(content) ? "" : content);
    context.startActivity(intent);
}
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:9,代碼來源:PhoneUtils.java

示例11: openSendMsg

public static void openSendMsg(Context context)
{
	Uri uri = Uri.parse("smsto:");
	Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
	context.startActivity(intent);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:7,代碼來源:TDevice.java

示例12: sendSms

/**
 * 短信分享
 *
 * @param mContext
 * @param smstext 短信分享內容
 * @return
 */
public static Boolean sendSms(Context mContext, String smstext) {
    Uri smsToUri = Uri.parse("smsto:");
    Intent mIntent = new Intent(Intent.ACTION_SENDTO, smsToUri);
    mIntent.putExtra("sms_body", smstext);
    mContext.startActivity(mIntent);
    return null;
}
 
開發者ID:zqHero,項目名稱:rongyunDemo,代碼行數:14,代碼來源:CommonUtils.java

示例13: sendEmail

/**
 * Отправить email
 *
 * @param context   контекст
 * @param addresses адреса эл. почты отправителей
 * @param subject   тема письма
 * @param text      текст
 */
public static void sendEmail(@Nullable Context context,
                             @Nullable String[] addresses,
                             @Nullable String subject,
                             @Nullable CharSequence text) {
    if (context != null) {
        Intent intent = new Intent(Intent.ACTION_SENDTO);
        intent.setData(Uri.parse("mailto:")); // only email apps should handle this
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        if (addresses != null && addresses.length > 0) {
            intent.putExtra(Intent.EXTRA_EMAIL, addresses);
        }
        if (!TextUtils.isEmpty(subject)) {
            intent.putExtra(Intent.EXTRA_SUBJECT, subject);
        }
        if (!TextUtils.isEmpty(text)) {
            intent.putExtra(Intent.EXTRA_TEXT, text);
        }
        if (intent.resolveActivity(context.getPackageManager()) != null) {
            context.startActivity(intent);
        } else {
            Toast.makeText(context, R.string.error_dont_have_email_app, Toast.LENGTH_SHORT)
                    .show();
        }
    }
}
 
開發者ID:interactiveservices,項目名稱:utils-android,代碼行數:34,代碼來源:IntentUtils.java

示例14: getSendSmsIntent

/**
 * 獲取跳至發送短信界麵的意圖
 *
 * @param phoneNumber 接收號碼
 * @param content 短信內容
 */
public static Intent getSendSmsIntent(String phoneNumber, String content) {
    Uri uri = Uri.parse("smsto:" + phoneNumber);
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    intent.putExtra("sms_body", content);
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
開發者ID:imliujun,項目名稱:LJFramework,代碼行數:12,代碼來源:IntentUtils.java

示例15: sendMMSFromUri

final void sendMMSFromUri(String uri, String subject, String body) {
  Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
  // The Messaging app needs to see a valid subject or else it will treat this an an SMS.
  if (subject == null || subject.isEmpty()) {
    putExtra(intent, "subject", activity.getString(R.string.msg_default_mms_subject));
  } else {
    putExtra(intent, "subject", subject);
  }
  putExtra(intent, "sms_body", body);
  intent.putExtra("compose_mode", true);
  launchIntent(intent);
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:12,代碼來源:ResultHandler.java


注:本文中的android.content.Intent.ACTION_SENDTO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。