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

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

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

Parcel.writeLongArray介绍

暂无

代码示例

代码示例来源:origin: h6ah4i/android-advancedrecyclerview

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

代码示例来源:origin: koral--/android-gif-drawable

@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(mStates.length);
  for (long[] mState : mStates)
    dest.writeLongArray(mState);
}

代码示例来源: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: hidroh/materialistic

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeLong(id);
  dest.writeString(title);
  dest.writeLong(time);
  dest.writeString(by);
  dest.writeLongArray(kids);
  dest.writeString(url);
  dest.writeString(text);
  dest.writeString(type);
  dest.writeInt(favorite ? 1 : 0);
  dest.writeInt(descendants);
  dest.writeInt(score);
  dest.writeInt(favorite ? 1 : 0);
  dest.writeInt(viewed ? 1 : 0);
  dest.writeInt(localRevision);
  dest.writeInt(level);
  dest.writeInt(dead ? 1 : 0);
  dest.writeInt(deleted ? 1 : 0);
  dest.writeInt(collapsed ? 1 : 0);
  dest.writeInt(contentExpanded ? 1 : 0);
  dest.writeInt(rank);
  dest.writeInt(lastKidCount);
  dest.writeInt(hasNewDescendants ? 1 : 0);
  dest.writeLong(parent);
  dest.writeInt(voted ? 1 : 0);
  dest.writeInt(pendingVoted ? 1 : 0);
  dest.writeLong(next);
  dest.writeLong(previous);
}

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

@Test
public void testReadWriteLongArray() throws Exception {
 final long[] longs = { 1, 2 };
 parcel.writeLongArray(longs);
 parcel.setDataPosition(0);
 final long[] longs2 = new long[longs.length];
 parcel.readLongArray(longs2);
 assertTrue(Arrays.equals(longs, longs2));
}

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

@Test
public void testWriteAndCreateNullLongArray() throws Exception {
 parcel.writeLongArray(null);
 parcel.setDataPosition(0);
 assertThat(parcel.createLongArray()).isNull();
}

代码示例来源:origin: codezjx/AndLinker

@Override
public void writeToParcel(Parcel dest, int flags, long[] val) {
  dest.writeLongArray(val);
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeInt(this.mOp);
 dest.writeInt(this.mMode);
 dest.writeLongArray(this.mTimes);
 dest.writeLongArray(this.mRejectTimes);
 dest.writeInt(this.mDuration);
 dest.writeByte((byte) (this.mRunning ? 1 : 0));
 dest.writeInt(this.mProxyUid);
 dest.writeString(this.mProxyPackageName);
 dest.writeInt(this.mAllowedCount);
 dest.writeInt(this.mIgnoredCount);
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(mode);
    dest.writeLongArray(selectedIds);
  }
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(mode);
    dest.writeLongArray(selectedIds);
  }
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(selection != null ? selection.length : 0);
    dest.writeLongArray(selection);
  }
}

代码示例来源:origin: geniusgithub/AndroidDialer

/** {@inheritDoc} */
@Override
public void writeToParcel(Parcel dest, int flags) {
  final int size = this.size();
  dest.writeInt(size);
  for (RawContactDelta delta : this) {
    dest.writeParcelable(delta, flags);
  }
  dest.writeLongArray(mJoinWithRawContactIds);
  dest.writeInt(mSplitRawContacts ? 1 : 0);
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(selection != null ? selection.length : 0);
    dest.writeLongArray(selection);
  }
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(selection != null ? selection.length : 0);
    dest.writeLongArray(selection);
  }
}

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

/**
   */
  @Override
  public void writeToParcel(@NonNull Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(selection != null ? selection.length : 0);
    dest.writeLongArray(selection);
  }
}

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

/**
 */
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(selectionMode);
  dest.writeInt(emptySelectionAllowed ? 1 : 0);
  dest.writeList(items);
  if (selection != null) {
    dest.writeInt(selection.length);
    dest.writeLongArray(selection);
  } else {
    dest.writeInt(-1);
  }
}

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

/**
 */
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(selectionMode);
  dest.writeInt(emptySelectionAllowed ? 1 : 0);
  dest.writeList(items);
  if (selection != null) {
    dest.writeInt(selection.length);
    dest.writeLongArray(selection);
  } else {
    dest.writeInt(-1);
  }
}

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

/**
 */
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(selectionMode);
  dest.writeInt(emptySelectionAllowed ? 1 : 0);
  dest.writeList(items);
  if (selection != null) {
    dest.writeInt(selection.length);
    dest.writeLongArray(selection);
  } else {
    dest.writeInt(-1);
  }
}

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

/**
 */
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeInt(selectionMode);
  dest.writeInt(emptySelectionAllowed ? 1 : 0);
  dest.writeList(items);
  if (selection != null) {
    dest.writeInt(selection.length);
    dest.writeLongArray(selection);
  } else {
    dest.writeInt(-1);
  }
}

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

@Override
public void writeToParcel(Parcel dest, int flags)
{
  super.writeToParcel(dest, flags);
  dest.writeString(torrentId);
  dest.writeLongArray(filesReceivedBytes);
  dest.writeInt(totalSeeds);
  dest.writeInt(seeds);
  dest.writeInt(downloadedPieces);
  dest.writeDouble(shareRatio);
  dest.writeLong(activeTime);
  dest.writeLong(seedingTime);
  dest.writeDouble(availability);
  dest.writeDoubleArray(filesAvailability);
}

相关文章

Parcel类方法