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

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

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

Parcel.readStringList介绍

[英]Read into the given List items String objects that were written with #writeStringListat the current dataPosition().
[中]读入给定的列表项字符串对象,这些对象是在当前dataPosition()处用#WriteStringList写入的。

代码示例

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

private List<String> readUnmodifiableStringList(final Parcel in) {
  final List<String> list = new ArrayList<String>();
  in.readStringList(list);
  return (list.size() == 0 ? null : Collections.unmodifiableList(list));
}

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

@Nullable
private List<String> readUnmodifiableStringList(final Parcel in) {
 final List<String> list = new ArrayList<>();
 in.readStringList(list);
 return (list.isEmpty()? null : Collections.unmodifiableList(list));
}

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

private UploadInfo(Parcel in) {
  uploadId = in.readString();
  startTime = in.readLong();
  currentTime = in.readLong();
  uploadedBytes = in.readLong();
  totalBytes = in.readLong();
  numberOfRetries = in.readInt();
  notificationID = in.readInt();
  if (notificationID == -1) {
    notificationID = null;
  }
  in.readStringList(filesLeft);
  in.readStringList(successfullyUploadedFiles);
}

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

AccessToken(Parcel parcel) {
  this.expires = new Date(parcel.readLong());
  ArrayList<String> permissionsList = new ArrayList<>();
  parcel.readStringList(permissionsList);
  this.permissions = Collections.unmodifiableSet(new HashSet<String>(permissionsList));
  permissionsList.clear();
  parcel.readStringList(permissionsList);
  this.declinedPermissions = Collections.unmodifiableSet(
      new HashSet<String>(permissionsList));
  this.token = parcel.readString();
  this.source = AccessTokenSource.valueOf(parcel.readString());
  this.lastRefresh = new Date(parcel.readLong());
  this.applicationId = parcel.readString();
  this.userId = parcel.readString();
  this.dataAccessExpirationTime = new Date(parcel.readLong());
}

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

private Request(Parcel parcel) {
  String enumValue = parcel.readString();
  this.loginBehavior = enumValue != null ? LoginBehavior.valueOf(enumValue) : null;
  ArrayList<String> permissionsList = new ArrayList<>();
  parcel.readStringList(permissionsList);
  this.permissions = new HashSet<String>(permissionsList);
  enumValue = parcel.readString();
  this.defaultAudience = enumValue != null ? DefaultAudience.valueOf(enumValue) : null;
  this.applicationId = parcel.readString();
  this.authId = parcel.readString();
  this.isRerequest = parcel.readByte() != 0;
  this.deviceRedirectUriString = parcel.readString();
  this.authType = parcel.readString();
  this.deviceAuthTargetUserId = parcel.readString();
}

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

GameRequestContent(final Parcel in) {
  this.message = in.readString();
  this.recipients = in.createStringArrayList();
  this.title = in.readString();
  this.data = in.readString();
  this.actionType = (ActionType) in.readSerializable();
  this.objectId = in.readString();
  this.filters = (Filters) in.readSerializable();
  this.suggestions = in.createStringArrayList();
  in.readStringList(this.suggestions);
}

代码示例来源: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: stackoverflow.com

private Custom(Parcel in){
  shortVakatName = new ArrayList<String>();
  vakatActive = new ArrayList<String>();

  alarmTitle = in.readString();
  in.readStringList(shortVakatName);
  in.readStringList(vakatActive);
  alarmType = in.readString();
  alarmTime = in.readString();
  alarmDate = in.readString();
}

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

State(Parcel parcel, String clazz, ParseParcelDecoder decoder) {
  className = clazz; // Already read
  objectId = parcel.readByte() == 1 ? parcel.readString() : null;
  createdAt = parcel.readLong();
  long updated = parcel.readLong();
  updatedAt = updated > 0 ? updated : createdAt;
  int size = parcel.readInt();
  HashMap<String, Object> map = new HashMap<>();
  for (int i = 0; i < size; i++) {
    String key = parcel.readString();
    Object obj = decoder.decode(parcel);
    map.put(key, obj);
  }
  serverData = Collections.unmodifiableMap(map);
  isComplete = parcel.readByte() == 1;
  List<String> available = new ArrayList<>();
  parcel.readStringList(available);
  availableKeys = new HashSet<>(available);
}

代码示例来源:origin: renyuneyun/Easer

private BTDeviceEventData(Parcel in) {
    in.readStringList(hwaddresses);
  }
}

代码示例来源:origin: renyuneyun/Easer

private BroadcastEventData(Parcel in) {
    intentData = new ReceiverSideIntentData();
    in.readStringList(intentData.action);
    in.readStringList(intentData.category);
  }
}

代码示例来源:origin: renyuneyun/Easer

private WifiEventData(Parcel in) {
    mode_essid = in.readByte() > 0;
    List<String> list = new ArrayList<>();
    in.readStringList(list);
    ssids.addAll(list);
  }
}

代码示例来源:origin: renyuneyun/Easer

private WifiConditionData(Parcel in) {
    mode_essid = in.readByte() > 0;
    List<String> list = new ArrayList<>();
    in.readStringList(list);
    ssids.addAll(list);
  }
}

代码示例来源:origin: proninyaroslav/libretorrent

public FileManagerConfig (Parcel source)
{
  path = source.readString();
  title = source.readString();
  highlightFileTypes = new ArrayList<>();
  source.readStringList(highlightFileTypes);
  showMode = source.readInt();
  fileName = source.readString();
}

代码示例来源:origin: WireGuard/wireguard-android

private InterfaceProxy(final Parcel in) {
  addresses = in.readString();
  dnsServers = in.readString();
  in.readStringList(excludedApplications);
  listenPort = in.readString();
  mtu = in.readString();
  privateKey = in.readString();
  publicKey = in.readString();
}

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

private LineCredential(@NonNull Parcel in) {
  accessToken = in.readParcelable(LineAccessToken.class.getClassLoader());
  List<String> modifiableScopes = new ArrayList<>(8);
  in.readStringList(modifiableScopes);
  scopes = Scope.convertToScopeList(modifiableScopes);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(mString);
  dest.writeInt(mInt);
  dest.writeStringList(mList);
}

public TestObject(Parcel in) {
  setmString(in.readString());
  setmInt(in.readInt());
  mList = new ArrayList<String>();
  in.readStringList(mList);
}

代码示例来源:origin: yukuku/androidbible

public Verse(Parcel in) {
  ordering = in.readInt();
  kind = VerseKind.values()[in.readInt()];
  in.readStringList(lines = new ArrayList<>());
}

代码示例来源:origin: osmandapp/osmand-api-demo

private void readFromParcel(Parcel in) {
  latitude = in.readDouble();
  longitude = in.readDouble();
  localName = in.readString();
  localTypeName = in.readString();
  alternateName = in.readString();
  in.readStringList(otherNames);
}

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

@Override
public AVIMOperationFailure createFromParcel(Parcel source) {
 AVIMOperationFailure result = new AVIMOperationFailure();
 result.setCode(source.readInt());
 result.setReason(source.readString());
 int memberCount = source.readInt();
 if (memberCount > 0) {
  List<String> memberList = new ArrayList<>(memberCount);
  source.readStringList(memberList);
  result.setMemberIds(memberList);
 }
 return result;
}

相关文章

Parcel类方法