万千封印
将数据从一项活动传递到另一项活动的标准方法:如果要将大量数据从一个活动发送到另一个活动,则可以将数据放入一个包中,然后使用putExtra()方法。//Create the `intent`
Intent i = new Intent(this, ActivityTwo.class);String one="xxxxxxxxxxxxxxx";String two="xxxxxxxxxxxxxxxxxxxxx";//Create the bundleBundle bundle = new Bundle();//Add your data to bundlebundle.putString(“ONE”, one);bundle.putString(“TWO”, two); //Add the bundle to the intenti.putExtras(bundle);//Fire that second activitystartActivity(i);否则您可以使用putExtra()直接发送数据和getExtra()来获取数据。Intent i=new Intent(this, ActivityTwo.class);i.putExtra("One",one);i.putExtra("Two",two);startActivity(i);