在startActivity()上传递一个包?
将捆绑包传递到当前正在启动的活动的正确方法是什么? 共享属性?
你有几个select:
1)使用意图中的Bundle :
Intent mIntent = new Intent(this, Example.class); Bundle extras = mIntent.getExtras(); extras.putString(key, value); 2)创build一个新的Bundle
 Intent mIntent = new Intent(this, Example.class); Bundle mBundle = new Bundle(); mBundle.putString(key, value); mIntent.putExtras(mBundle); 
3)使用Intent的putExtra()快捷方法
 Intent mIntent = new Intent(this, Example.class); mIntent.putExtra(key, value); 
然后,在启动的活动中,您可以通过以下方式阅读:
 String value = getIntent().getExtras().getString(key) 
注意: Bundle对所有的原始types,Parcelables和Serializables都有“get”和“put”方法。 我只是用string作示范。
你可以使用Intent的Bundle:
 Bundle extras = myIntent.getExtras(); extras.put*(info); 
或整个捆绑:
 myIntent.putExtras(myBundle); 
这是你在找什么?
在Android中将数据从一个Activity传递给Activity
 意图包含动作和可选的附加数据。 可以使用intent putExtra()方法将数据传递给其他活动。 数据是作为额外的传递,是key/value pairs 。 关键是总是一个string。 作为值,您可以使用基本数据typesint,float,chars等。我们也可以将Parceable and Serializable对象从一个活动传递给另一个活动。 
 Intent intent = new Intent(context, YourActivity.class); intent.putExtra(KEY, <your value here>); startActivity(intent); 
从android活动检索包数据
 您可以使用Intent对象上的getData()方法检索信息。  Intent对象可以通过getIntent()方法获取。 
  Intent intent = getIntent(); if (null != intent) { //Null Checking String StrData= intent.getStringExtra(KEY); int NoOfData = intent.getIntExtra(KEY, defaultValue); boolean booleanData = intent.getBooleanExtra(KEY, defaultValue); char charData = intent.getCharExtra(KEY, defaultValue); }