下面列出了android.os.Parcel#writeIntArray ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeIntArray(new int[]{
id,
topics
});
String[] strings = new String[6];
strings[0] = name;
strings[1] = title;
strings[2] = url;
if((strings[3] = titleAlternative) == null){
strings[3] = "";
}
if((strings[4] = header) == null){
strings[4] = "";
}
if((strings[5] = footer) == null){
strings[5] = "";
}
dest.writeStringArray(strings);
dest.writeBooleanArray(new boolean[]{ isCollected });
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.age);
dest.writeLong(this.id);
dest.writeInt(this.testShort);
dest.writeByte(this.testByte);
dest.writeByte(this.testBoolean ? (byte) 1 : (byte) 0);
dest.writeFloat(this.testFloat);
dest.writeDouble(this.testDouble);
dest.writeInt(this.testChar);
dest.writeValue(this.testLONG);
dest.writeValue(this.testDOUBLE);
dest.writeSerializable(this.testCharacter);
dest.writeValue(this.testBOOLEAN);
dest.writeValue(this.testSHORT);
dest.writeString(this.name);
dest.writeParcelable(this.data, flags);
dest.writeTypedList(this.datas);
dest.writeTypedArray(this.testArrayResultData, flags);
dest.writeIntArray(this.testArrayInt);
dest.writeArray(this.testArrayInteger);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mPosition);
dest.writeInt(mGapDir);
dest.writeInt(mHasUnwantedGapAfter ? 1 : 0);
if (mGapPerSpan != null && mGapPerSpan.length > 0) {
dest.writeInt(mGapPerSpan.length);
dest.writeIntArray(mGapPerSpan);
} else {
dest.writeInt(0);
}
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
// Write the preference's values
dest.writeInt(current);
dest.writeIntArray(colors);
dest.writeInt(columns);
dest.writeByte((byte) (material ? 1 : 0));
dest.writeByte((byte) (backwardsOrder ? 1 : 0));
dest.writeInt(strokeWidth);
dest.writeInt(strokeColor);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.action);
dest.writeString(this.packageName);
dest.writeInt(this.userHandleId);
dest.writeInt(this.opInt);
dest.writeInt(this.modeInt);
dest.writeIntArray(this.ops);
dest.writeByte(this.reqNet ? (byte) 1 : (byte) 0);
}
/**
* Used to package this object into a {@link Parcel}.
*
* @param dest The {@link Parcel} to be written.
* @param flags The flags used for parceling.
*/
@Override
public void writeToParcel(Parcel dest, int flags) {
final int infoSize = mSuggestionsInfos.length;
dest.writeInt(infoSize);
dest.writeTypedArray(mSuggestionsInfos, 0);
dest.writeIntArray(mOffsets);
dest.writeIntArray(mLengths);
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeLong(magicLink.expiry);
parcel.writeDouble(magicLink.price);
parcel.writeInt(magicLink.ticketStart);
parcel.writeInt(magicLink.ticketCount);
parcel.writeString(magicLink.contractAddress);
parcel.writeInt(magicLink.indices.length);
parcel.writeIntArray(magicLink.indices);
parcel.writeInt(magicLink.signature.length);
parcel.writeByteArray(magicLink.signature);
parcel.writeInt(magicLink.message.length);
parcel.writeByteArray(magicLink.message);
parcel.writeString(magicLink.priceWei.toString(10));
}
@Override
public void writeToParcel(final Parcel out, final int flags) {
// Gathering data
final int[] integers = new int[]{clientID, samplesGotten, samplesPut,
eventsGotten, eventsPut, lastActivity, waitEvents, waitSamples,
error, diff};
final long[] longs = new long[]{timeLastActivity, waitTimeout, time};
// Write it to parcel
out.writeString(address);
out.writeIntArray(integers);
out.writeLongArray(longs);
out.writeInt(connected ? 1 : 0);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(stackId);
dest.writeInt(bounds.left);
dest.writeInt(bounds.top);
dest.writeInt(bounds.right);
dest.writeInt(bounds.bottom);
dest.writeIntArray(taskIds);
dest.writeStringArray(taskNames);
final int boundsCount = taskBounds == null ? 0 : taskBounds.length;
dest.writeInt(boundsCount);
for (int i = 0; i < boundsCount; i++) {
dest.writeInt(taskBounds[i].left);
dest.writeInt(taskBounds[i].top);
dest.writeInt(taskBounds[i].right);
dest.writeInt(taskBounds[i].bottom);
}
dest.writeIntArray(taskUserIds);
dest.writeInt(displayId);
dest.writeInt(userId);
dest.writeInt(visible ? 1 : 0);
dest.writeInt(position);
if (topActivity != null) {
dest.writeInt(1);
topActivity.writeToParcel(dest, 0);
} else {
dest.writeInt(0);
}
configuration.writeToParcel(dest, flags);
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeIntArray(mOps);
dest.writeInt(mTransition);
dest.writeInt(mTransitionStyle);
dest.writeString(mName);
dest.writeInt(mIndex);
dest.writeInt(mBreadCrumbTitleRes);
TextUtils.writeToParcel(mBreadCrumbTitleText, dest, 0);
dest.writeInt(mBreadCrumbShortTitleRes);
TextUtils.writeToParcel(mBreadCrumbShortTitleText, dest, 0);
}
@Override
public void writeToParcel(@NonNull Parcel parcel, int flags) {
int size = size();
int[] keys = new int[size];
Parcelable[] values = new Parcelable[size];
for (int i = 0; i < size; ++i) {
keys[i] = keyAt(i);
values[i] = valueAt(i);
}
parcel.writeInt(size);
parcel.writeIntArray(keys);
parcel.writeParcelableArray(values, flags);
}
@Override
public void writeToParcel(Parcel dest, int flags)
{
dest.writeString(mPaletteId);
dest.writeString(mPaletteName);
dest.writeIntArray(mColors);
dest.writeInt(mColumns);
dest.writeStringArray(mColorNames);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeIntArray(getOrdinals(orms));
dest.writeIntArray(getOrdinals(opTypes));
dest.writeIntArray(this.rounds);
dest.writeInt(this.time == null ? -1 : this.time.ordinal());
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
// Write the preference's values
dest.writeInt(current);
dest.writeIntArray(colors);
dest.writeInt(columns);
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
int[] keys = new int[size()];
boolean[] values = new boolean[size()];
for (int i = 0; i < size(); i++) {
keys[i] = keyAt(i);
values[i] = valueAt(i);
}
dest.writeInt(size());
dest.writeIntArray(keys);
dest.writeBooleanArray(values);
}
@Override
public void writeToParcel(final Parcel out, final int flags) {
// Gathering data
final int[] integers = new int[]{connectionID, samplesGotten, samplesPut,
eventsGotten, eventsPut, lastActivity, waitEvents, waitSamples,
error, diff};
final long[] longs = new long[]{timeLastActivity, waitTimeout, time};
// Write it to parcel
out.writeString(address);
out.writeIntArray(integers);
out.writeLongArray(longs);
out.writeInt(connected ? 1 : 0);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeIntArray(this.a);
dest.writeDoubleArray(this.b);
dest.writeStringArray(this.c);
dest.writeFloatArray(this.e);
dest.writeBooleanArray(this.f);
dest.writeByteArray(this.g);
}
@Override
public void writeToParcel(Parcel dest, int flags)
{
dest.writeString(mName);
dest.writeIntArray(mValues);
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeTypedArray(mActive, flags);
dest.writeIntArray(mAdded);
dest.writeTypedArray(mBackStack, flags);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(pathX.size());
dest.writeIntArray(getXArray());
dest.writeIntArray(getYArray());
}