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

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

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

Parcel.readIntArray介绍

暂无

代码示例

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

/* package */ SelectionOverride(Parcel in) {
 groupIndex = in.readInt();
 length = in.readByte();
 tracks = new int[length];
 in.readIntArray(tracks);
}

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

@Implementation
protected static Bitmap nativeCreateFromParcel(Parcel p) {
 int parceledWidth = p.readInt();
 int parceledHeight = p.readInt();
 Bitmap.Config parceledConfig = (Bitmap.Config) p.readSerializable();
 int[] parceledColors = new int[parceledHeight * parceledWidth];
 p.readIntArray(parceledColors);
 return createBitmap(parceledColors, parceledWidth, parceledHeight, parceledConfig);
}

代码示例来源:origin: rey5137/material

if(length > 0) {
  mSelectedIndexes = new int[length];
  in.readIntArray(mSelectedIndexes);

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

@Test
public void testReadWriteIntArray() throws Exception {
 final int[] ints = { 1, 2 };
 parcel.writeIntArray(ints);
 // Make sure a copy was stored.
 ints[0] = 99;
 ints[1] = 99;
 parcel.setDataPosition(0);
 final int[] ints2 = new int[ints.length];
 parcel.readIntArray(ints2);
 assertThat(ints2).isEqualTo(new int[] {1, 2});
}

代码示例来源:origin: nglauber/dominando_android2

private EstadoJogo(Parcel p) {
  super(p);
  vez = p.readInt();
  tabuleiro = new int[3][3];
  for (int linha = 0; linha < tabuleiro.length; linha++) {
    p.readIntArray(tabuleiro[linha]);
  }
}
public final Parcelable.Creator<EstadoJogo>

代码示例来源:origin: henrichg/PhoneProfilesPlus

private SavedState(Parcel in) {
  super(in);
  mDateInputPointer = in.readInt();
  mYearInputPointer = in.readInt();
  in.readIntArray(mDateInput);
  in.readIntArray(mYearInput);
  mMonthInput = in.readInt();
}

代码示例来源:origin: henrichg/PhoneProfilesPlus

private SavedState(Parcel in) {
  super(in);
  mInputPointer = in.readInt();
  in.readIntArray(mInput);
  mAmPmState = in.readInt();
}

代码示例来源:origin: henrichg/PhoneProfilesPlus

private SavedState(Parcel in) {
  super(in);
  mYearInputPointer = in.readInt();
  in.readIntArray(mYearInput);
  mMonthInput = in.readInt();
}

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

private SavedState(Parcel in) {
  this.order = in.readString();
  this.page = in.readInt();
  this.pageList = new ArrayList<>();
  int[] pages = new int[in.readInt()];
  in.readIntArray(pages);
  pageList = new ArrayList<>(pages.length);
  for (int p : pages) {
    pageList.add(p);
  }
  this.over = in.readByte() != 0;
}

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

public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeInt(mMyArray.length);        // First write array length
  out.writeIntArray(mMyIntArray);       // Then array content
}

protected MyObj(Parcel in) {
  super(in);
  mMyIntArray = new int[in.readInt()];
  in.readIntArray(mMyIntArray);
}

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

public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeIntArray(mMyIntArray);        // In this example array length is 4
}

protected MyObj(Parcel in) {
  super(in);
  mMyIntArray = new int[4];
  in.readIntArray(mMyIntArray);
}

代码示例来源:origin: com.albedinsky.android/ui-widget-picker

/**
 * Called from {@link #CREATOR} to create an instance of SavedState form the given parcel
 * <var>source</var>.
 *
 * @param source Parcel with data for the new instance.
 */
protected SavedState(@NonNull Parcel source) {
  super(source);
  this.selection = source.readInt();
  this.selectionRange = source.readInt();
  source.readIntArray(numbers = new int[source.readInt()]);
  this.numberFormat = (NumberFormat) source.readSerializable();
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 * Called from {@link #CREATOR} to create an instance of SavedState form the given parcel
 * <var>source</var>.
 *
 * @param source Parcel with data for the new instance.
 */
protected SavedState(@NonNull Parcel source) {
  super(source);
  this.selection = source.readInt();
  this.selectionRange = source.readInt();
  source.readIntArray(numbers = new int[source.readInt()]);
  this.numberFormat = (NumberFormat) source.readSerializable();
}

代码示例来源:origin: com.albedinsky.android/dialogs

/**
 * Called from {@link #CREATOR} to create an instance of SavedState form the given parcel
 * <var>source</var>.
 *
 * @param source Parcel with data for the new instance.
 */
protected SavedState(@NonNull Parcel source) {
  super(source);
  this.content = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
  this.progressFormat = source.readString();
  this.progressIndicatorVisible = source.readInt() == 1;
  source.readIntArray(progress);
}

代码示例来源:origin: org.robolectric/framework

@Implementation
public static Bitmap nativeCreateFromParcel(Parcel p) {
 int parceledWidth = p.readInt();
 int parceledHeight = p.readInt();
 Bitmap.Config parceledConfig = (Bitmap.Config) p.readSerializable();
 int[] parceledColors = new int[parceledHeight * parceledWidth];
 p.readIntArray(parceledColors);
 return createBitmap(parceledColors, parceledWidth, parceledHeight, parceledConfig);
}

代码示例来源:origin: org.robolectric/shadows-framework

@Implementation
protected static Bitmap nativeCreateFromParcel(Parcel p) {
 int parceledWidth = p.readInt();
 int parceledHeight = p.readInt();
 Bitmap.Config parceledConfig = (Bitmap.Config) p.readSerializable();
 int[] parceledColors = new int[parceledHeight * parceledWidth];
 p.readIntArray(parceledColors);
 return createBitmap(parceledColors, parceledWidth, parceledHeight, parceledConfig);
}

代码示例来源:origin: org.robolectric/shadows-core

@Implementation
public static Bitmap nativeCreateFromParcel(Parcel p) {
 int parceledWidth = p.readInt();
 int parceledHeight = p.readInt();
 Bitmap.Config parceledConfig = (Bitmap.Config) p.readSerializable();
 int[] parceledColors = new int[parceledHeight * parceledWidth];
 p.readIntArray(parceledColors);
 return createBitmap(parceledColors, parceledWidth, parceledHeight, parceledConfig);
}

代码示例来源:origin: org.robolectric/shadows-core-v23

@Implementation
public static Bitmap nativeCreateFromParcel(Parcel p) {
 int parceledWidth = p.readInt();
 int parceledHeight = p.readInt();
 Bitmap.Config parceledConfig = (Bitmap.Config) p.readSerializable();
 int[] parceledColors = new int[parceledHeight * parceledWidth];
 p.readIntArray(parceledColors);
 return createBitmap(parceledColors, parceledWidth, parceledHeight, parceledConfig);
}

代码示例来源:origin: QuickBlox/q-municate-android

public ParcelableQBDialog(Parcel inputParcel) {
  dialog = new QBChatDialog(inputParcel.readString());
  dialog.setName(inputParcel.readString());
  dialog.setType(QBDialogType.parseByCode(inputParcel.readInt()));
  dialog.setRoomJid(inputParcel.readString());
  dialog.setLastMessage(inputParcel.readString());
  dialog.setLastMessageDateSent(inputParcel.readLong());
  int[] occupantArray = new int[inputParcel.readInt()];
  inputParcel.readIntArray(occupantArray);
  dialog.setOccupantsIds(Utils.toArrayList(occupantArray));
}

代码示例来源:origin: Belolme/RxBLE

private BLEDevice(Parcel in) {
  int[] intArr = new int[1];
  in.readIntArray(intArr);
  setRssi(intArr[0]);
  String[] strings = new String[3];
  in.readStringArray(strings);
  setDeviceName(strings[0]);
  setMac(strings[1]);
}

相关文章

Parcel类方法