/**
* Add extended data to the intent. The name must include a package
* prefix, for example the app com.android.contacts would use names
* like "com.android.contacts.ShowAll".
*
* @param name The name of the extra data, with package prefix.
* @param value The String data value.
*
* @return Returns the same Intent object, for chaining multiple calls
* into a single statement.
*
* @see #putExtras
* @see #removeExtra
* @see #getStringExtra(String)
*/
public Intent putExtra(String name, String value) {
if (mExtras == null) {
mExtras = new Bundle();
}
mExtras.putString(name, value);
return this;
}
你就算用 intent传 里面也会自动生成一个bundle的。
所以实际上都是用bundle
一楼已经回答的很正确了,我只是贴出个源码来:
好像是bundle能传递的数据类型多?