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

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

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

Parcel.writeStringArray介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeString(elementId);
 dest.writeByte((byte) (isRoot ? 1 : 0));
 dest.writeByte((byte) (isOrdered ? 1 : 0));
 dest.writeStringArray(children);
 dest.writeInt(subFrames.length);
 for (Id3Frame subFrame : subFrames) {
  dest.writeParcelable(subFrame, 0);
 }
}

代码示例来源:origin: bluelinelabs/Conductor

@Override
public void writeToParcel(Parcel out, int flags) {
  out.writeString(instanceId);
  out.writeStringArray(permissions);
  out.writeInt(requestCode);
}

代码示例来源:origin: smuyyh/BookReader

@Override
  public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    tagCount = tags.length;
    dest.writeInt(tagCount);
    dest.writeStringArray(tags);
    dest.writeInt(checkedPosition);
    dest.writeString(input);
  }
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.mode);
  dest.writeInt(this.installFlags);
  dest.writeInt(this.installLocation);
  dest.writeLong(this.sizeBytes);
  dest.writeString(this.appPackageName);
  dest.writeParcelable(this.appIcon, flags);
  dest.writeString(this.appLabel);
  dest.writeLong(this.appIconLastModified);
  dest.writeParcelable(this.originatingUri, flags);
  dest.writeParcelable(this.referrerUri, flags);
  dest.writeString(this.abiOverride);
  dest.writeString(this.volumeUuid);
  dest.writeStringArray(this.grantedRuntimePermissions);
}

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

dest.writeStringArray(new String[] {this.id,
                  this.name,
                  this.grade});

代码示例来源:origin: googlesamples/android-testing

@Override
public void writeToParcel(Parcel out, int flags) {
  // Prepare an array of strings and an array of timestamps.
  String[] texts = new String[mData.size()];
  long[] timestamps = new long[mData.size()];
  // Store the data in the arrays.
  for (int i = 0; i < mData.size(); i++) {
    texts[i] = mData.get(i).first;
    timestamps[i] = mData.get(i).second;
  }
  // Write the size of the arrays first.
  out.writeInt(texts.length);
  // Write the two arrays in a specific order.
  out.writeStringArray(texts);
  out.writeLongArray(timestamps);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeLong(this.gid);
  dest.writeString(this.token);
  dest.writeString(this.archiverKey);
  dest.writeString(this.title);
  dest.writeString(this.titleJpn);
  dest.writeInt(this.category);
  dest.writeString(this.thumb);
  dest.writeString(this.uploader);
  dest.writeLong(this.posted);
  dest.writeInt(this.filecount);
  dest.writeLong(this.filesize);
  dest.writeByte(expunged ? (byte) 1 : (byte) 0);
  dest.writeFloat(this.rating);
  dest.writeInt(this.torrentcount);
  dest.writeStringArray(this.tags);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeLong(this.gid);
  dest.writeString(this.token);
  dest.writeString(this.title);
  dest.writeString(this.titleJpn);
  dest.writeString(this.thumb);
  dest.writeInt(this.category);
  dest.writeString(this.posted);
  dest.writeString(this.uploader);
  dest.writeFloat(this.rating);
  dest.writeString(this.simpleLanguage);
  dest.writeStringArray(this.simpleTags);
  dest.writeInt(this.thumbWidth);
  dest.writeInt(this.thumbHeight);
  dest.writeInt(this.spanSize);
  dest.writeInt(this.spanIndex);
  dest.writeInt(this.spanGroupIndex);
}

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

@Test
public void testReadWriteStringArray() throws Exception {
 final String[] strings = { "foo", "bar" };
 parcel.writeStringArray(strings);
 parcel.setDataPosition(0);
 final String[] strings2 = new String[strings.length];
 parcel.readStringArray(strings2);
 assertTrue(Arrays.equals(strings, strings2));
}

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

@Test
public void testWriteAndCreateNullStringArray() throws Exception {
 parcel.writeStringArray(null);
 parcel.setDataPosition(0);
 assertThat(parcel.createStringArray()).isNull();
}

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

@Test
public void testCreateStringArray() {
 String[] strs = { "a1", "b2" };
 parcel.writeStringArray(strs);
 parcel.setDataPosition(0);
 String[] newStrs = parcel.createStringArray();
 assertTrue(Arrays.equals(strs, newStrs));
}

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

@Override public void writeToParcel(Parcel dest, int flags) {
 super.writeToParcel(dest, flags);
 dest.writeStringArray(this.fields);
}

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

@Override public void writeToParcel(Parcel dest, int flags) {
 super.writeToParcel(dest, flags);
 dest.writeStringArray(fields);
}

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

public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeStringArray(mItems);
  out.writeInt(mSelectedItemPosition);

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

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

代码示例来源:origin: consp1racy/android-support-preference

@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeStringArray(values.toArray(new String[values.size()]));
}

代码示例来源:origin: 8enet/AppOpsX

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.serviceName);
  dest.writeString(this.methodName);
  dest.writeStringArray(this.sParamsType);
  dest.writeArray(this.params);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(this.type);
  dest.writeStringArray(this.imageUrls);
  dest.writeByte(this.isFullScreen ? (byte) 1 : (byte) 0);
  dest.writeTypedList(this.contentViewOriginModels);
  dest.writeInt(this.position);
}

代码示例来源:origin: 8enet/AppOpsX

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.packageName);
  dest.writeString(this.className);
  dest.writeStringArray(this.sParamsType);
  dest.writeArray(this.params);
}

代码示例来源:origin: klinker41/android-smsmms

@Override
public void onMeteredIfacesChanged(java.lang.String[] meteredIfaces) throws android.os.RemoteException {
  android.os.Parcel _data = android.os.Parcel.obtain();
  try {
    _data.writeInterfaceToken(DESCRIPTOR);
    _data.writeStringArray(meteredIfaces);
    mRemote.transact(Stub.TRANSACTION_onMeteredIfacesChanged, _data, null, android.os.IBinder.FLAG_ONEWAY);
  } finally {
    _data.recycle();
  }
}

相关文章

Parcel类方法