Java Code Examples for android.os.Parcel#writeArray()

The following examples show how to use android.os.Parcel#writeArray() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: timecat   File: SimpleDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onWriteToParcel(Parcel dest, int flags) {
    dest.writeInt(mMode);
    switch (mMode) {
        case MODE_MESSAGE:
            dest.writeValue(mMessage);
            break;
        case MODE_ITEMS:
            dest.writeArray(mItems);
            dest.writeInt(mSelectedIndexes == null ? 0 : mSelectedIndexes[0]);
            break;
        case MODE_MULTI_ITEMS:
            dest.writeArray(mItems);
            int length = mSelectedIndexes == null ? 0 : mSelectedIndexes.length;
            dest.writeInt(length);
            if (length > 0) dest.writeIntArray(mSelectedIndexes);
            break;
    }
}
 
Example 2
@Override
public void writeToParcel(Parcel parcel, int i)
{
    parcel.writeString(address);
    parcel.writeString(name);
    parcel.writeString(balance);
    parcel.writeString(symbol);
    int opWrite = operation.ordinal();
    parcel.writeInt(opWrite);
    parcel.writeInt(type);
    parcel.writeString(otherParty);

    if (indices != null)
    {
        parcel.writeInt(indices.size());
        parcel.writeArray(indices.toArray());
    }
    else
    {
        parcel.writeInt(0);
    }
}
 
Example 3
Source Project: data-mediator   File: HistoryData.java    License: Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 4
Source Project: material   File: SimpleDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onWriteToParcel(Parcel dest, int flags) {
    dest.writeInt(mMode);
    switch (mMode){
        case MODE_MESSAGE:
            dest.writeValue(mMessage);
            break;
        case MODE_ITEMS:
            dest.writeArray(mItems);
            dest.writeInt(mSelectedIndexes == null ? 0 : mSelectedIndexes[0]);
            break;
        case MODE_MULTI_ITEMS:
            dest.writeArray(mItems);
            int length = mSelectedIndexes == null ? 0 : mSelectedIndexes.length;
            dest.writeInt(length);
            if(length > 0)
                dest.writeIntArray(mSelectedIndexes);
            break;
        }
    }
 
Example 5
Source Project: Mobilyzer   File: RRCTask.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeString(echoHost);
  dest.writeString(target);
  dest.writeInt(MIN);
  dest.writeInt(MAX);
  dest.writeInt(port);
  dest.writeInt(size);
  dest.writeInt(sizeGranularity);
  dest.writeByte((byte) (DNS ? 1 : 0));
  dest.writeByte((byte) (HTTP ? 1 : 0));
  dest.writeByte((byte) (TCP ? 1 : 0));
  dest.writeByte((byte) (RRC ? 1 : 0));
  dest.writeByte((byte) (SIZES ? 1 : 0));
  dest.writeByte((byte) (RESULT_VISIBILITY ? 1 : 0));
  dest.writeInt(GIVEUP_THRESHHOLD);
  dest.writeArray(times);
}
 
Example 6
Source Project: Cake-VPN   File: LogItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);
    dest.writeLong(logtime);
}
 
Example 7
Source Project: SimpleOpenVpn-Android   File: LogItem.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);

    dest.writeLong(logtime);
}
 
Example 8
Source Project: alpha-wallet-android   File: ERC721Ticket.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(balanceArray.size());
    dest.writeInt(contractType.ordinal());
    if (balanceArray.size() > 0) dest.writeArray(balanceArray.toArray());
}
 
Example 9
Source Project: alpha-wallet-android   File: Ticket.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeInt(balanceArray.size());
    dest.writeInt(contractType.ordinal());
    if (balanceArray.size() > 0) dest.writeArray(balanceArray.toArray());
}
 
Example 10
Source Project: alpha-wallet-android   File: TicketRangeParcel.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags)
{
    dest.writeArray(range.tokenIds.toArray());
    dest.writeInt(range.isChecked ? 1:0);
    dest.writeString(range.contractAddress);
}
 
Example 11
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);
    dest.writeLong(logtime);
}
 
Example 12
Source Project: AppOpsX   File: ClassCaller.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.packageName);
    dest.writeString(this.className);
    dest.writeStringArray(this.sParamsType);
    dest.writeArray(this.params);
}
 
Example 13
Source Project: AppOpsX   File: SystemServiceCaller.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.serviceName);
    dest.writeString(this.methodName);
    dest.writeStringArray(this.sParamsType);
    dest.writeArray(this.params);
}
 
Example 14
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);

    dest.writeLong(logtime);
}
 
Example 15
Source Project: island   File: MethodInvocation.java    License: Apache License 2.0 5 votes vote down vote up
@Override public void writeToParcel(final Parcel dest, final int flags) {
	if ((flags & PARCELABLE_WRITE_RETURN_VALUE) == 0) {
		dest.writeString(clazz);
		dest.writeArray(args);
	} else {
		dest.writeValue(result);
		dest.writeSerializable(throwable);
	}
}
 
Example 16
Source Project: android   File: VpnStatus.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);

    dest.writeLong(logtime);
}
 
Example 17
Source Project: android-nfc-lib   File: TestUtilities.java    License: MIT License 5 votes vote down vote up
public Tag mockTag(String technology) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
    // For future reference

    // Parameters :
    byte[] b = {0x8};
    String ndefClass = "android.nfc.tech.Ndef";

    // FieldName which marks the capacity of the tag
    String extraNdefMaxlength = (String) Class.forName(ndefClass).getField("EXTRA_NDEF_MAXLENGTH").get(null);

    // FieldName which marks the tags writability
    String cardWritableStateField = (String) Class.forName(ndefClass).getField("EXTRA_NDEF_CARDSTATE").get(null);

    // Field to mark tag R/W
    int cardWritable = Class.forName(ndefClass).getField("NDEF_MODE_READ_WRITE").getInt(null);

    Bundle techExtras = new Bundle();

    techExtras.putInt(extraNdefMaxlength, 2048);
    techExtras.putInt(cardWritableStateField, cardWritable);
    Bundle[] extras = {techExtras};
    int[] technologies = {TagTechnology.class.getField(technology.toUpperCase()).getInt(null)}; //https://android.googlesource.com/platform/frameworks/base.git/+/android-4.3_r2/core/java/android/nfc/tech/TagTechnology.java


    // https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/nfc/Tag.java :376
    Parcel parcel = Parcel.obtain();

    parcel.writeByteArray(b); //Sets the ID
    parcel.writeIntArray(technologies); // Sets the technology to NDEF
    parcel.writeArray(extras); // Needed to set properties for NDEF tag
    parcel.writeInt(1); // Service handle
    parcel.writeInt(1); // Indicating a mock

    return Tag.CREATOR.createFromParcel(parcel);
}
 
Example 18
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeArray(mArgs);
    dest.writeString(mMessage);
    dest.writeInt(mRessourceId);
    dest.writeInt(mLevel.getInt());
    dest.writeInt(mVerbosityLevel);

    dest.writeLong(logtime);
}
 
Example 19
Source Project: android-test   File: ParcelableResult.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel out, int flags) {
  out.writeArray(failures.toArray());
}