Code example for Parcel

Methods: writeLong, writeString, writeTypedList

0
    public int describeContents() { 
      return 0; 
    } 
 
    public void writeToParcel(Parcel dest, int flags) {
      dest.writeLong(id);
      dest.writeString(name);
      dest.writeTypedList(numbers);
    } 
  } 
 
  /*** 
   * If the code below looks shitty to you, that's because it was taken 
   * directly from the Android source, where shitty code is all you get. 
   */ 
 
  public Cursor getCursorForRecipientFilter(CharSequence constraint,
      ContentResolver mContentResolver)
  { 
    final String SORT_ORDER = Contacts.TIMES_CONTACTED + " DESC," +
                              Contacts.DISPLAY_NAME + "," + Phone.TYPE;