Code example for Parcel

Methods: writeParcelable, writeStringArray

0
 
    @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);
    } 
 
    /** @return whether this intent has one of send actions */ 
    public boolean isShareIntent() { 
      return isSingleShare() || isMultipleShare(); 
    } 
    /** @return whether this intent has action {@link Intent#ACTION_SEND} */ 
    public boolean isSingleShare() { 
      return Intent.ACTION_SEND.equals(intent.getAction());
    }