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

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

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

Parcel.writeStringList介绍

[英]Flatten a List containing String objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. They can later be retrieved with #createStringArrayList or #readStringList.
[中]将包含字符串对象的列表展平到地块中,在当前dataPosition()处,如果需要,增加dataCapacity()。稍后可以使用#createStringArrayList或#readStringList检索它们。

代码示例

代码示例来源:origin: seven332/EhViewer

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeParcelable(this.mPositionList, flags);
  dest.writeStringList(this.mImageUrlList);
  dest.writeStringList(this.mPageUrlList);
}

代码示例来源:origin: seven332/EhViewer

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.groupName);
  dest.writeStringList(this.mTagList);
}

代码示例来源:origin: Justson/AgentWeb

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeStringList(mPermissions);
  dest.writeInt(mAction);
  dest.writeInt(mFromIntention);
}

代码示例来源:origin: seven332/EhViewer

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeParcelable(this.mPositionList, flags);
  dest.writeStringList(this.mImageKeyList);
  dest.writeStringList(this.mImageUrlList);
  dest.writeParcelable(this.mOffsetXList, flags);
  dest.writeParcelable(this.mOffsetYList, flags);
  dest.writeParcelable(this.mClipWidthList, flags);
  dest.writeParcelable(this.mClipHeightList, flags);
  dest.writeStringList(this.mPageUrlList);
}

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

public void writeToParcel(final Parcel out, final int flags) {
  out.writeParcelable(this.contentUrl, 0);
  out.writeStringList(this.peopleIds);
  out.writeString(this.placeId);
  out.writeString(this.pageId);
  out.writeString(this.ref);
  out.writeParcelable(this.hashtag, 0);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(id);
  dest.writeString(mName);
  dest.writeByte((byte) (mPredefined ? 1 : 0));
  dest.writeByte((byte) (mManualSearch ? 1 : 0));
  dest.writeStringList(new ArrayList<>(mAccountUuids));
  dest.writeParcelable(mConditions, flags);
}

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

@Override
public void writeToParcel(Parcel parcel, int arg1) {
  parcel.writeString(uploadId);
  parcel.writeLong(startTime);
  parcel.writeLong(currentTime);
  parcel.writeLong(uploadedBytes);
  parcel.writeLong(totalBytes);
  parcel.writeInt(numberOfRetries);
  parcel.writeInt(notificationID == null ? -1 : notificationID);
  parcel.writeStringList(filesLeft);
  parcel.writeStringList(successfullyUploadedFiles);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeLong(expires.getTime());
  dest.writeStringList(new ArrayList<String>(permissions));
  dest.writeStringList(new ArrayList<String>(declinedPermissions));
  dest.writeString(token);
  dest.writeString(source.name());
  dest.writeLong(lastRefresh.getTime());
  dest.writeString(applicationId);
  dest.writeString(userId);
  dest.writeLong(dataAccessExpirationTime.getTime());
}

代码示例来源: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: facebook/facebook-android-sdk

@Override
public void writeToParcel(final Parcel out, final int flags) {
 super.writeToParcel(out, flags);
 out.writeParcelable(this.mBackgroundAsset, 0);
 out.writeParcelable(this.mStickerAsset, 0);
 out.writeStringList(this.mBackgroundColorList);
 out.writeString(this.mAttributionLink);
}

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

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(loginBehavior != null ? loginBehavior.name() : null);
    dest.writeStringList(new ArrayList<String>(permissions));
    dest.writeString(defaultAudience != null ? defaultAudience.name() : null);
    dest.writeString(applicationId);
    dest.writeString(authId);
    dest.writeByte((byte)(isRerequest ? 1 : 0));
    dest.writeString(deviceRedirectUriString);
    dest.writeString(authType);
    dest.writeString(deviceAuthTargetUserId);
}

代码示例来源:origin: hidroh/materialistic

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeList(list);
  dest.writeStringList(new ArrayList<>(expanded));
}

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

dest.writeInt(age);
dest.writeString(name);
dest.writeStringList(address);

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

public void writeToParcel(Parcel dest, int flags) {
  /**
   * NOTE: When adding fields in the process of updating this API, make sure to bump
   * {@link #PARCELABLE_VERSION}.
   */
  dest.writeInt(PARCELABLE_VERSION);
  // Inject a placeholder that will store the parcel size from this point on
  // (not including the size itself).
  int sizePosition = dest.dataPosition();
  dest.writeInt(0);
  int startPosition = dest.dataPosition();
  // version 1
  dest.writeInt(result);
  // signatureOnly is deprecated since version 3. we pass a dummy value for compatibility
  dest.writeByte((byte) 0);
  dest.writeString(primaryUserId);
  dest.writeLong(keyId);
  // version 2
  dest.writeStringList(userIds);
  // version 3
  writeEnumWithNull(dest, senderStatusResult);
  dest.writeStringList(confirmedUserIds);
  // Go back and write the size
  int parcelableSize = dest.dataPosition() - startPosition;
  dest.setDataPosition(sizePosition);
  dest.writeInt(parcelableSize);
  dest.setDataPosition(startPosition + parcelableSize);
}

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

dest.writeStringList(this.requestedPermissions);
dest.writeStringList(this.protectedBroadcasts);
dest.writeParcelable(this.applicationInfo, flags);
dest.writeBundle(this.mAppMetaData);
dest.writeString(this.mVersionName);
dest.writeString(this.mSharedUserId);
dest.writeStringList(this.usesLibraries);
dest.writeInt(this.mVersionCode);
dest.writeInt(this.mSharedUserLabel);

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

@Test
public void testReadAndWriteStringList() throws Exception {
 ArrayList<String> original = new ArrayList<>();
 List<String> rehydrated = new ArrayList<>();
 original.add("str1");
 original.add("str2");
 parcel.writeStringList(original);
 parcel.setDataPosition(0);
 parcel.readStringList(rehydrated);
 assertEquals(2, rehydrated.size());
 assertEquals("str1", rehydrated.get(0));
 assertEquals("str2", rehydrated.get(1));
}

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

@Test
public void testCreateStringArrayList() throws Exception {
 parcel.writeStringList(Arrays.asList("str1", "str2"));
 parcel.setDataPosition(0);
 List<String> actual = parcel.createStringArrayList();
 assertEquals(2, actual.size());
 assertEquals("str1", actual.get(0));
 assertEquals("str2", actual.get(1));
}

代码示例来源:origin: chenyangcun/MaterialDesignExample

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(type);
    dest.writeLong(id);
    dest.writeInt(gaPrefix);
    dest.writeStringList(images);
    dest.writeString(title);
  }
}

代码示例来源:origin: parse-community/Parse-SDK-Android

protected void writeToParcel(Parcel dest, ParseParcelEncoder encoder) {
  dest.writeString(className);
  dest.writeByte(objectId != null ? (byte) 1 : 0);
  if (objectId != null) {
    dest.writeString(objectId);
  }
  dest.writeLong(createdAt);
  dest.writeLong(updatedAt);
  dest.writeInt(serverData.size());
  Set<String> keys = serverData.keySet();
  for (String key : keys) {
    dest.writeString(key);
    encoder.encode(serverData.get(key), dest);
  }
  dest.writeByte(isComplete ? (byte) 1 : 0);
  dest.writeStringList(new ArrayList<>(availableKeys));
}

代码示例来源:origin: cn.leancloud.android/avoscloud-push

/**
 * Parcelable 接口实现
 */
public void writeToParcel(Parcel dest, int flags) {
 int memberCount = getMemberIdCount();
 dest.writeInt(this.code);
 dest.writeString(this.reason);
 dest.writeInt(memberCount);
 if (memberCount > 0) {
  dest.writeStringList(this.memberIds);
 }
}

相关文章

Parcel类方法