Java Code Examples for android.os.Parcel.writeParcelableArray()

The following are Jave code examples for showing how to use writeParcelableArray() of the android.os.Parcel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: cwac-crossport   File: CoordinatorLayout.java   Source Code and License Vote up 6 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);

  final int size = behaviorStates != null ? behaviorStates.size() : 0;
  dest.writeInt(size);

  final int[] ids = new int[size];
  final Parcelable[] states = new Parcelable[size];

  for (int i = 0; i < size; i++) {
    ids[i] = behaviorStates.keyAt(i);
    states[i] = behaviorStates.valueAt(i);
  }
  dest.writeIntArray(ids);
  dest.writeParcelableArray(states, flags);

}
 
Example 2
Project: trust-wallet-android   File: Transaction.java   Source Code and License Vote up 6 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
       dest.writeString(hash);
       dest.writeString(error);
       dest.writeString(blockNumber);
       dest.writeLong(timeStamp);
	dest.writeInt(nonce);
	dest.writeString(from);
	dest.writeString(to);
	dest.writeString(value);
	dest.writeString(gas);
	dest.writeString(gasPrice);
	dest.writeString(input);
	dest.writeString(gasUsed);
	dest.writeParcelableArray(operations, flags);
}
 
Example 3
Project: kognitivo   File: LoginClient.java   Source Code and License Vote up 5 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelableArray(handlersToTry, flags);
    dest.writeInt(currentHandler);
    dest.writeParcelable(pendingRequest, flags);
    Utility.writeStringMapToParcel(dest, loggingExtras);
}
 
Example 4
Project: nifi-android-s2s   File: DataCollectorTestImpl.java   Source Code and License Vote up 5 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(dataPacketListQueue.size());
    for (List<DataPacket> dataPackets : dataPacketListQueue) {
        dest.writeParcelableArray(dataPackets.toArray(new DataPacket[dataPackets.size()]), 0);
    }
}
 
Example 5
Project: boohee_v5.6   File: ParcelableSparseArray.java   Source Code and License Vote up 5 votes
public void writeToParcel(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] = (Parcelable) valueAt(i);
    }
    parcel.writeInt(size);
    parcel.writeIntArray(keys);
    parcel.writeParcelableArray(values, flags);
}
 
Example 6
Project: boohee_v5.6   File: CoordinatorLayout.java   Source Code and License Vote up 5 votes
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    int size = this.behaviorStates != null ? this.behaviorStates.size() : 0;
    dest.writeInt(size);
    int[] ids = new int[size];
    Parcelable[] states = new Parcelable[size];
    for (int i = 0; i < size; i++) {
        ids[i] = this.behaviorStates.keyAt(i);
        states[i] = (Parcelable) this.behaviorStates.valueAt(i);
    }
    dest.writeIntArray(ids);
    dest.writeParcelableArray(states, flags);
}