Intent的基本作用
1、Component name 启动的Activity或Service或BroadcastReceiver等的名字
2、Action 指定另一个Activity要做的动作,如果ACTION_CALL、ACTION_EDIT等
3、Data Uri
4、Category
5、Extras 键值对
6、Flags
Intent intent = new Intent();
intent.putExtra(“testIntent”, “123”); //传值
Intent.setClass(Activity02.this, OtherActivity.class);
Activity02.this.StartActivity(intent); //启动OtherActivity
在OtherActivity中取得
Intent intent = getIntent();
String value = intent.getStringExtra(“testIntent”);
启动发短信的Activity
Uri uri = Uri.parse(“smsto://0800000123”);
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
Intent.putExtra(“sms_body”, “The SMS text”);
startActivity(intent);