android.os.Parcel.writeSerializable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(254)

本文整理了Java中android.os.Parcel.writeSerializable()方法的一些代码示例,展示了Parcel.writeSerializable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.writeSerializable()方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:writeSerializable

Parcel.writeSerializable介绍

[英]Write a generic serializable object in to a Parcel. It is strongly recommended that this method be avoided, since the serialization overhead is extremely large, and this approach will be much slower than using the other approaches to writing data in to a Parcel.
[中]将通用可序列化对象写入地块。强烈建议避免使用这种方法,因为序列化开销非常大,而且这种方法比使用其他方法将数据写入包要慢得多。

代码示例

代码示例来源:origin: android-hacker/VirtualXposed

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeSerializable(this.e);
  }
}

代码示例来源:origin: wdullaer/MaterialDateTimePicker

@Override
public void writeToParcel(Parcel out, int flags) {
  out.writeInt(mMinYear);
  out.writeInt(mMaxYear);
  out.writeSerializable(mMinDate);
  out.writeSerializable(mMaxDate);
  out.writeSerializable(selectableDays);
  out.writeSerializable(disabledDays);
}

代码示例来源:origin: gotev/android-upload-service

@Override
public void writeToParcel(Parcel parcel, int arg1) {
  parcel.writeString(path);
  parcel.writeSerializable(properties);
}

代码示例来源:origin: facebook/facebook-android-sdk

public void writeToParcel(final Parcel out, final int flags) {
  out.writeString(this.name);
  out.writeString(this.description);
  out.writeSerializable(this.privacy);
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeSerializable(this.mediaType);
  dest.writeString(this.attachmentId);
  dest.writeParcelable(this.mediaUrl, flags);
  dest.writeParcelable(this.button, flags);
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeLong(this.sofarBytes);
  dest.writeSerializable(this.throwable);
}

代码示例来源:origin: stackoverflow.com

@Override
public void writeToParcel(Parcel out, int flags) {
  // Write object
  out.writeSerializable(date_object);

}

private void readFromParcel(Parcel in) {
  // Read object
  date_object = (java.util.Date) in.readSerializable();

}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(this.sofarBytes);
  dest.writeSerializable(this.throwable);
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
public void writeToParcel(final Parcel out, final int flags) {
  super.writeToParcel(out, flags);
  out.writeByte((byte)(this.isSharable ? 1 : 0));
  out.writeSerializable(this.imageAspectRatio);
  out.writeParcelable(this.genericTemplateElement, flags);
}

代码示例来源:origin: facebook/facebook-android-sdk

public void writeToParcel(final Parcel out, final int flags) {
  out.writeString(this.message);
  out.writeStringList(this.recipients);
  out.writeString(this.title);
  out.writeString(this.data);
  out.writeSerializable(this.actionType);
  out.writeString(this.objectId);
  out.writeSerializable(this.filters);
  out.writeStringList(this.suggestions);
}

代码示例来源:origin: k9mail/k-9

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeParcelable(uri, flags);
  dest.writeSerializable(state);
  dest.writeInt(loaderId);
  dest.writeString(contentType);
  dest.writeInt(allowMessageType ? 1 : 0);
  dest.writeString(name);
  if (size != null) {
    dest.writeInt(1);
    dest.writeLong(size);
  } else {
    dest.writeInt(0);
  }
  dest.writeString(filename);
}

代码示例来源:origin: robolectric/robolectric

@Implementation
protected void writeToParcel(Parcel p, int flags) {
 p.writeInt(width);
 p.writeInt(height);
 p.writeSerializable(config);
 p.writeIntArray(colors);
}

代码示例来源:origin: gotev/android-upload-service

@Override
public void writeToParcel(Parcel parcel, int flags) {
  parcel.writeInt(httpCode);
  parcel.writeInt(body.length);
  parcel.writeByteArray(body);
  parcel.writeSerializable(headers);
}

代码示例来源:origin: gotev/android-upload-service

@Override
public void writeToParcel(Parcel parcel, int flags) {
  parcel.writeInt(status.ordinal());
  parcel.writeSerializable(exception);
  parcel.writeParcelable(uploadInfo, flags);
  parcel.writeParcelable(serverResponse, flags);
}

代码示例来源:origin: stackoverflow.com

public void writeToParcel(Parcel out, int flags) {
  out.writeString(_mac);
  out.writeString(_pan);
  out.writeInt(_band);
  out.writeSerializable(_lqis);
  out.writeTypedList(_devices);
}

private ZigBeeNetwork(Parcel in) {
  _mac = in.readString();
  _pan = in.readString();
  _band = in.readInt();
  _lqis = (ArrayList<Integer>) in.readSerializable();
  in.readTypedList(_devices, ZigBeeDev.CREATOR);
}

代码示例来源:origin: igreenwood/SimpleCropView

@Override public void writeToParcel(Parcel out, int flag) {
 super.writeToParcel(out, flag);
 out.writeSerializable(mode);
 out.writeInt(backgroundColor);
 out.writeInt(overlayColor);
 out.writeInt(frameColor);
 out.writeSerializable(guideShowMode);
 out.writeSerializable(handleShowMode);
 out.writeInt(showGuide ? 1 : 0);
 out.writeInt(showHandle ? 1 : 0);
 out.writeParcelable(sourceUri, flag);
 out.writeParcelable(saveUri, flag);
 out.writeSerializable(compressFormat);
 out.writeInt(compressQuality);
 out.writeInt(isDebug ? 1 : 0);

代码示例来源:origin: ArthurHub/Android-Image-Cropper

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeParcelable(getOriginalUri(), flags);
 dest.writeParcelable(getUri(), flags);
 dest.writeSerializable(getError());
 dest.writeFloatArray(getCropPoints());
 dest.writeParcelable(getCropRect(), flags);
 dest.writeParcelable(getWholeImageRect(), flags);
 dest.writeInt(getRotation());
 dest.writeInt(getSampleSize());
}

代码示例来源:origin: FolioReader/FolioReader-Android

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(id);
  dest.writeString(bookId);
  dest.writeString(pageId);
  dest.writeString(rangy);
  dest.writeString(content);
  dest.writeSerializable(date);
  dest.writeString(type);
  dest.writeInt(pageNumber);
  dest.writeString(note);
  dest.writeString(uuid);
}

代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher

@Override
public void writeToParcel(final Parcel dest, final int flags) {
  super.writeToParcel(dest, flags);
  dest.writeSerializable(layoutPolicy);
  dest.writeBundle(modelState);
}

代码示例来源:origin: guolindev/giffun

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeParcelable(getOriginalUri(), flags);
 dest.writeParcelable(getUri(), flags);
 dest.writeSerializable(getError());
 dest.writeFloatArray(getCropPoints());
 dest.writeParcelable(getCropRect(), flags);
 dest.writeParcelable(getWholeImageRect(), flags);
 dest.writeInt(getRotation());
 dest.writeInt(getSampleSize());
}

相关文章

Parcel类方法