Intent intent = new Intent().setClassName("com.bundletest", "com.bundletest.Bundle02");
Bundle bundle = new Bundle();
bundle.putString("name", "skywang");
bundle.putInt("height", 175);
intent.putExtras(bundle);
startActivity(intent);
finish();
对应的读数据的方法如下:
Bundle bundle = this.getIntent().getExtras();
String name = bundle.getString("name");
int height = bundle.getInt("height");