1.传普通值
设置值:intent.putExtra("key",value);
取出值:Intent intent = getIntent();
value=intent.getExtra("key");
2.传对象值
设置值:
Bundle bundle = new Bundle();
bundle.putSerializable("subApp", apps.get(position));
intent.putExtras(bundle);
this.startActivity(intent);
取出值:
Intent intent = getIntent();
AppInfo app = (AppInfo) intent.getExtras().get("subApp");
注意:此时AppInfo及其引用类必须 implements Serializable
3.传Uri值
用法1:
intent.setData(Uri.parse(input.getText().toString()));
Intent intent = getIntent();
mUri = intent.getData();
用法2:
Uri uri =Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL,uri);