Code example for Parcel

Methods: createStringArray, readParcelable

0
    SharingData() { 
      // nothing 
    } 
 
    SharingData(final Parcel in) {
      this.intent = in.readParcelable(getClass().getClassLoader());
      this.contentNames = in.createStringArray();
    } 
 
    @Override 
    public int describeContents() { return 0; } 
    @Override 
    public void writeToParcel(final Parcel dest, final int flags) {
      dest.writeParcelable(intent, flags);
      dest.writeStringArray(contentNames);
    } 
 
    private void cacheStreams() { 
      this.cachedStreams = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
    }