Android学习——Intent的使用
2015-03-08 23:27
489 查看
intent的简单用法 Intent 一些简单用法
传值:Intent intent=new Intent();
intent.putExtra("extra", "这是页面一传来的值!");
intent.setClass(Test_for_intentActivity.this, actpage2.class);
startActivity(intent);取值:Intent intent=getIntent();
String StringE=intent.getStringExtra("extra");
TextView text2=(TextView)findViewById(R.id.textView2);
text2.setText(StringE); 打开网页Uri uri = Uri.parse("http://www.google.com");
Intent it
= new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);
拨打电话
Uri uri =Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL,uri);
startActivity(it);
6.调用发短信的程序
Intent it = newIntent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "TheSMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
//发送附件
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");
sendIntent.setType("audio/mp3");
startActivity(Intent.createChooser(it, "Choose Email Client"));
传值:Intent intent=new Intent();
intent.putExtra("extra", "这是页面一传来的值!");
intent.setClass(Test_for_intentActivity.this, actpage2.class);
startActivity(intent);取值:Intent intent=getIntent();
String StringE=intent.getStringExtra("extra");
TextView text2=(TextView)findViewById(R.id.textView2);
text2.setText(StringE); 打开网页Uri uri = Uri.parse("http://www.google.com");
Intent it
= new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);
拨打电话
Uri uri =Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL,uri);
startActivity(it);
6.调用发短信的程序
Intent it = newIntent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "TheSMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
//发送附件
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");
sendIntent.setType("audio/mp3");
startActivity(Intent.createChooser(it, "Choose Email Client"));
相关文章推荐
- Android学习 - Intent使用
- android学习记录(五)显式Intent与隐式Intent的功能与使用方法解析。
- Android初级学习之Intent的简单使用
- Android开发之基本组件学习-----------Intent的使用
- android学习:通过Intent打开Activity的两种方法,Intent过滤器的使用方法
- Android学习总结(十)———— Intent的使用
- 学习Android中Intent的使用
- Android Intent的几种用法全面总结(供自我学习查阅使用)
- Android(java)学习笔记146:Bundle和Intent类使用和交互
- Android项目之HomeHealth基础学习3:Intent使用Component
- Android学习之Intent使用
- android学习序列笔记之Intent使用方法
- Android学习之 Intent几种使用方法使用
- Android Studio 学习 - 基本控件的使用;Intent初学
- Android学习之Intent使用
- android学习4#--使用Intent创建Activity
- Android学习之Intent使用
- Android学习——Intent的使用
- Android学习之Intent使用
- Android学习备忘011——使用Intent传递数据之返回结果