ParcelableとBundle、意図を持って発信したい情報のパッケージです!
Bundle: 新規に開始する場合は、作成したとともに に情報をactivity送信できます。Bundleactivitynew Intent
// Bundle b is sent with new intent i
Bundle b = new Bundle();
b.putString(key, value);
b.putInt(key, value);
Intent i = new Intent(...);
i.putExtras(b);
startActivity(i);
// In the activity which started from the intent i, you can get the bundle b
this.getIntent().getExtras();
Parcelable(独自のクラス) をまたは と一緒interfaceに渡したい場合は、これを実装する必要があります。objectbundleintentinterface
class Example implements Parcelable{
// some information here
}
// You can send with intent or bundle:
b.putParcelable(key, value);
i.putExtra(name, value);
Google Android の詳細はこちら: Bundle Parcelable