安卓activity之间进行数据传输
一:单个对象传输 (1)基本数据传输(String Int) Intent intent = new Intent ( this , NewActivity . class ) ; intent . putExtra ( "name" , "android" ) ; intent . putExtra ( "version" , 9 ) ; startActivity ( intent ) ; 在另外一个NewActivity.java的onCreate获取 protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_new ) ; Intent intent = getIntent ( ) ; String name = intent . getStringExtra ( "name" ) ; int ver = intent . getIntExtra ( "version" , 0 ) ; Log . d ( TAG , " name =" + name + " version=" + ver ) ; } (2)Bundle集装箱数据传输 传递方: Intent