Android常见的Intent积累
2013-10-29 15:38
429 查看
1.新建书签
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setAction("android.intent.action.INSERT");
intent.putExtra("url", "http://www.baidu.com");
intent.putExtra("title", "baidu");
intent.setType("vnd.android.cursor.dir/bookmark");
startActivity(intent);
2.新建Email
String[] reciver = new String[] { toAddress };
Intent myIntent = new Intent("com.android.email.intent.action.REPLY");
myIntent.setAction(Intent.ACTION_VIEW);
myIntent.setAction(Intent.ACTION_SEND);
myIntent.setType("plain/text");// 文字
// myIntent.setType("*/*");
// myIntent.setType("application/x-gzip");
// myIntent.setType("application/octet-stream");
myIntent.putExtra(android.content.Intent.EXTRA_EMAIL, reciver);
myIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, mSubject);
myIntent.putExtra(android.content.Intent.EXTRA_TEXT, mContent);
if (isHasAcctachmentFile) {
myIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachmentFile));
}
3.新建彩信:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
File file = new File(Environment.getExternalStorageDirectory(), "1.jpg");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
//intent.setType("application/octet-stream");
//intent.setType("plain/text");//文字
intent.setType("image/png");
//intent.putExtra(Intent.EXTRA_STREAM, uri);//uri为你的附件的uri
intent.putExtra("subject", "subString");
intent.putExtra("sms_body", "sdfsdf");
intent.putExtra("address", "12345645123");
intent.putExtra("compose_mode", false);
intent.putExtra(Intent.EXTRA_TEXT, "sdfsdf");
//intent.setType("vnd.android-dir/mms-sms");
//intent.setAction(Intent.ACTION_VIEW);
//intent.setType("image/*");//彩信附件类型
intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
startActivity(intent);
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setAction("android.intent.action.INSERT");
intent.putExtra("url", "http://www.baidu.com");
intent.putExtra("title", "baidu");
intent.setType("vnd.android.cursor.dir/bookmark");
startActivity(intent);
2.新建Email
String[] reciver = new String[] { toAddress };
Intent myIntent = new Intent("com.android.email.intent.action.REPLY");
myIntent.setAction(Intent.ACTION_VIEW);
myIntent.setAction(Intent.ACTION_SEND);
myIntent.setType("plain/text");// 文字
// myIntent.setType("*/*");
// myIntent.setType("application/x-gzip");
// myIntent.setType("application/octet-stream");
myIntent.putExtra(android.content.Intent.EXTRA_EMAIL, reciver);
myIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, mSubject);
myIntent.putExtra(android.content.Intent.EXTRA_TEXT, mContent);
if (isHasAcctachmentFile) {
myIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachmentFile));
}
3.新建彩信:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
File file = new File(Environment.getExternalStorageDirectory(), "1.jpg");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
//intent.setType("application/octet-stream");
//intent.setType("plain/text");//文字
intent.setType("image/png");
//intent.putExtra(Intent.EXTRA_STREAM, uri);//uri为你的附件的uri
intent.putExtra("subject", "subString");
intent.putExtra("sms_body", "sdfsdf");
intent.putExtra("address", "12345645123");
intent.putExtra("compose_mode", false);
intent.putExtra(Intent.EXTRA_TEXT, "sdfsdf");
//intent.setType("vnd.android-dir/mms-sms");
//intent.setAction(Intent.ACTION_VIEW);
//intent.setType("image/*");//彩信附件类型
intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
startActivity(intent);
相关文章推荐
- [Android基础知识] 之六:Intent.Action的各种常见应用
- Android中Intent的各种常见作用
- Android开发之Intent.Action Android中Intent的各种常见作用
- Android Intent机制和常见用法
- Android中Intent的各种常见作用。
- Android Intent的常见用法
- Android 中的(意图Intent)机制,常见应用
- android Intent常见应用
- Android intent 常见用法
- Android Intent 常见用法总结
- android Intent 常见用法和使用场景
- Android Intent常见的FLAG
- Android中Intent.action的各种常见作用
- Android 之常见Intent
- Android中Intent的各种常见作用
- Android开发积累_2)权限、Intent
- android之intent常见调用方法
- android 常见异常错误积累
- Android开发之Intent.Action Android中Intent的各种常见作用
- Android 积累一些常见的开发异常与问题