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

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

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

Parcel.createTypedArrayList介绍

[英]Read and return a new ArrayList containing a particular object type from the parcel that was written with #writeTypedList at the current dataPosition(). Returns null if the previously written list object was null. The list must have previously been written via #writeTypedList with the same object type.
[中]从当前dataPosition()处使用#writeTypedList写入的包裹中读取并返回包含特定对象类型的新ArrayList。如果之前写入的列表对象为null,则返回null。列表必须以前使用相同的对象类型通过#writeTypedList写入。

代码示例

代码示例来源:origin: yanzhenjie/NoHttp

protected NewsWrapper(Parcel in) {
  mDataList = in.createTypedArrayList(News.CREATOR);
}

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

VLocConfig(Parcel in) {
  this.mode = in.readInt();
  this.cell = in.readParcelable(VCell.class.getClassLoader());
  this.allCell = in.createTypedArrayList(VCell.CREATOR);
  this.neighboringCell = in.createTypedArrayList(VCell.CREATOR);
  this.location = in.readParcelable(VLocation.class.getClassLoader());
}

代码示例来源:origin: chentao0707/SimplifyReader

protected ImageBucket(Parcel in) {
  this.count = in.readInt();
  this.bucketName = in.readString();
  this.bucketList = in.createTypedArrayList(ImageItem.CREATOR);
}

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

protected UploadNotificationStatusConfig(Parcel in) {
  this.title = in.readString();
  this.message = in.readString();
  this.autoClear = in.readByte() != 0;
  this.clearOnAction = in.readByte() != 0;
  this.largeIcon = in.readParcelable(Bitmap.class.getClassLoader());
  this.iconResourceID = in.readInt();
  this.iconColorResourceID = in.readInt();
  this.clickIntent = in.readParcelable(PendingIntent.class.getClassLoader());
  this.actions = in.createTypedArrayList(UploadNotificationAction.CREATOR);
}

代码示例来源:origin: mttkay/ignition

/**
 * @see com.github.droidfu.cachefu.CachedModel#readFromParcel(android.os.Parcel)
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void readFromParcel(Parcel source) throws IOException {
  super.readFromParcel(source);
  // Read class from parcel, then load class and use creator to generate new object from data
  String className = source.readString();
  try {
    clazz = (Class<? extends CachedModel>) Class.forName(className);
    list = source.createTypedArrayList((Creator) clazz.getField("CREATOR").get(this));
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

protected CircleItem(Parcel in) {
  this.address = in.readString();
  this.appointUserNickname = in.readString();
  this.appointUserid = in.readString();
  this.content = in.readString();
  this.createTime = in.readLong();
  this.goodjobCount = in.readInt();
  this.id = in.readString();
  this.isvalid = in.readString();
  this.latitude = in.readDouble();
  this.longitude = in.readDouble();
  this.pictures = in.readString();
  this.replyCount = in.readInt();
  this.type = in.readInt();
  this.icon = in.readString();
  this.userId = in.readString();
  this.nickName = in.readString();
  this.goodjobs = in.createTypedArrayList(FavortItem.CREATOR);
  this.replys = in.createTypedArrayList(CommentItem.CREATOR);
  this.linkImg = in.readString();
  this.linkTitle = in.readString();
  this.takeTimes = in.readInt();
}

代码示例来源:origin: Rukey7/MvpApp

this.ptime = in.readString();
this.specialID = in.readString();
this.ads = in.createTypedArrayList(AdData.CREATOR);
this.imgextra = new ArrayList<ImgExtraData>();
in.readList(this.imgextra, ImgExtraData.class.getClassLoader());

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

this.mVersionCode = in.readInt();
this.mSharedUserLabel = in.readInt();
this.configPreferences = in.createTypedArrayList(ConfigurationInfo.CREATOR);
this.reqFeatures = in.createTypedArrayList(FeatureInfo.CREATOR);

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

@Test
public void testWriteTypedListAndCreateTypedArrayList() throws Exception {
 TestParcelable normal = new TestParcelable(23);
 ArrayList<TestParcelable> normals = new ArrayList<>();
 normals.add(normal);
 parcel.writeTypedList(normals);
 parcel.setDataPosition(0);
 List<org.robolectric.shadows.TestParcelable> rehydrated = parcel
   .createTypedArrayList(TestParcelable.CREATOR);
 assertEquals(1, rehydrated.size());
 assertEquals(23, rehydrated.get(0).contents);
}

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

@Override
public java.util.List<android.app.job.JobInfo> getAllPendingJobs() throws android.os.RemoteException {
  android.os.Parcel _data = android.os.Parcel.obtain();
  android.os.Parcel _reply = android.os.Parcel.obtain();
  java.util.List<android.app.job.JobInfo> _result;
  try {
    _data.writeInterfaceToken(DESCRIPTOR);
    mRemote.transact(Stub.TRANSACTION_getAllPendingJobs, _data, _reply, 0);
    _reply.readException();
    _result = _reply.createTypedArrayList(android.app.job.JobInfo.CREATOR);
  } finally {
    _reply.recycle();
    _data.recycle();
  }
  return _result;
}

代码示例来源:origin: jaredrummler/AndroidProcesses

private Cgroup(Parcel in) {
 super(in);
 this.groups = in.createTypedArrayList(ControlGroup.CREATOR);
}

代码示例来源:origin: guoxiaoxing/phoenix

protected PhoenixOption(Parcel in) {
  this.fileType = in.readInt();
  this.enableCamera = in.readByte() != 0;
  this.theme = in.readInt();
  this.maxPickNumber = in.readInt();
  this.minPickNumber = in.readInt();
  this.videoFilterTime = in.readInt();
  this.mediaFilterSize = in.readInt();
  this.recordVideoTime = in.readInt();
  this.spanCount = in.readInt();
  this.thumbnailWidth = in.readInt();
  this.thumbnailHeight = in.readInt();
  this.enableAnimation = in.readByte() != 0;
  this.enableGif = in.readByte() != 0;
  this.enablePreview = in.readByte() != 0;
  this.pickNumberMode = in.readByte() != 0;
  this.enableClickSound = in.readByte() != 0;
  this.previewEggs = in.readByte() != 0;
  this.enableCompress = in.readByte() != 0;
  this.compressVideoFilterSize = in.readInt();
  this.compressPictureFilterSize = in.readInt();
  this.pickedMediaList = in.createTypedArrayList(MediaEntity.CREATOR);
  this.savePath = in.readString();
}

代码示例来源:origin: laucherish/PureZhihuD

protected NewsList(Parcel in) {
  this.date = in.readString();
  this.stories = in.createTypedArrayList(News.CREATOR);
  this.top_stories = in.createTypedArrayList(TopNews.CREATOR);
}

代码示例来源:origin: mingjunli/GithubApp

protected SearchResultResp(Parcel in) {
  this.total_count = in.readLong();
  this.incomplete_results = in.readByte() != 0;
  this.items = in.createTypedArrayList(Repo.CREATOR);
}

代码示例来源:origin: WangDaYeeeeee/Mysplash

protected RelatedCollections(Parcel in) {
  this.total = in.readInt();
  this.type = in.readString();
  this.results = in.createTypedArrayList(Collection.CREATOR);
}

代码示例来源:origin: mingjunli/GithubApp

protected RepoDetail(Parcel in) {
  this.baseRepo = in.readParcelable(Repo.class.getClassLoader());
  this.readme = in.readParcelable(Content.class.getClassLoader());
  this.forks = in.createTypedArrayList(Repo.CREATOR);
  this.contributors = in.createTypedArrayList(User.CREATOR);
}

代码示例来源:origin: gitskarios/GithubAndroidSdk

protected PushEventPayload(Parcel in) {
 super(in);
 this.push_id = in.readLong();
 this.size = in.readInt();
 this.distinct_size = in.readInt();
 this.ref = in.readString();
 this.head = in.readString();
 this.before = in.readString();
 this.commits = in.createTypedArrayList(Commit.CREATOR);
}

代码示例来源:origin: huangfangyi/FanXin

protected UMenuItem(Parcel in) {
  title = in.readString();
  type = in.readString();
  description = in.readString();
  parent = in.readParcelable(UMenuItem.class.getClassLoader());
  defaultSelected = in.readInt();
  isVisible = in.readByte() != 0;
  childs = in.createTypedArrayList(UMenuItem.CREATOR);
}

代码示例来源:origin: zzkong/BaseProject

protected ImageListBean(Parcel in) {
  this.col = in.readString();
  this.tag = in.readString();
  this.tag3 = in.readString();
  this.sort = in.readString();
  this.totalNum = in.readInt();
  this.startIndex = in.readInt();
  this.returnNumber = in.readInt();
  this.imgs = in.createTypedArrayList(ImageBean.CREATOR);
}

代码示例来源:origin: moyokoo/Diooto

protected DiootoConfig(Parcel in) {
  this.type = in.readInt();
  this.imageUrls = in.createStringArray();
  this.isFullScreen = in.readByte() != 0;
  this.contentViewOriginModels = in.createTypedArrayList(ContentViewOriginModel.CREATOR);
  this.position = in.readInt();
}

相关文章

Parcel类方法