当前位置: 首页>>代码示例>>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;未经允许,请勿转载。