Bundle用法说明

发送:
public void uriToActivity(String name, String uri)
 {
 Intent intent = new Intent();
 intent.setClass(ActivityMain.this, ActivityUser.class); 
Bundle bundle = new Bundle(); 
bundle.putString("name", name);
 bundle.putString("uri", uri);
 intent.putExtras(bundle); 
startActivity(intent); } //
接收:
publicvoid onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
Bundle bundle = this.getIntent().getExtras(); 
if (bundle != null) { 
uri = bundle.getString("uri"); 
name = bundle.getString("name"); 
} 
}

你可能感兴趣的:(android,Bundle,intent)