Add extended data to the intent

extras -- This is a Bundle of any additional information. This can be used to provide extended information to the component. For example, if we have a action to send an e-mail message, we could also include extra pieces of data here to supply a subject, body, etc.

  1. putExtra(String name, int value)

    • 所有的基本数据类型及其数组:char, byte, boolean, short, int, long, float, double, char[], byte[], boolean[], short[], int[], long[], float[], double[]

    • 字串及其数组:String, String[], CharSequence, CharSequence[]

    • 序列化类型:Serializable, Parcelable, Parcelable[]

    • Bundle

  2. 几种类型的 ArrayList:

     putIntegerArrayListExtra(String name, ArrayList<Integer> value)
     putCharSequenceArrayListExtra(String name, ArrayList<CharSequence> value)
     putStringArrayListExtra(String name, ArrayList<String> value)
     // ParcelableArray 是 Parcelable 优于 Serializable 的一点
     putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value)