附带电话号码(调用系统短信):
Intent mIntent = new Intent(Intent.ACTION_VIEW); mIntent.putExtra("address",phoneNum); mIntent.putExtra("sms_body", ""); mIntent.setType("vnd.android-dir/mms-sms"); context.startActivity(mIntent);
附带短信内容(调用系统短信):
Uri smsToUri = Uri.parse("smsto:");// 联系人地址 Intent mIntent = new Intent(android.content.Intent.ACTION_SENDTO, smsToUri); mIntent.putExtra("sms_body", "abcdefgh");// 短信内容 context.startActivity(mIntent);附带邮件内容(调用系统邮件):
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); // 文本格式 emailIntent.setType("text/plain"); // 对方邮件地址 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, ""); // 标题内容 emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""); // 邮件文本内容 emailIntent .putExtra(android.content.Intent.EXTRA_TEXT, "abcdefgh"); context.startActivity(Intent.createChooser(emailIntent, "Choose Email Client"));
调用系统添加联系人:
Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); intent.putExtra("name", ""); intent.putExtra("phone", number); context.startActivity(intent);调用系统添加或编辑联系人:
Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.setType("vnd.android.cursor.item/contact"); intent.putExtra(Intents.Insert.PHONE, number); context.startActivity(intent);调用系统编辑联系人:
Intent i = new Intent(Intent.ACTION_EDIT); i.setData(ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,contactid)); context.startActivity(i);