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

The following examples show how to use android.os.Parcel#writeArray() . 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 File: SimpleDialog.java    From timecat with 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
Source File: ERC875ContractTransaction.java    From alpha-wallet-android with MIT License 6 votes vote down vote up
@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 File: RRCTask.java    From Mobilyzer with 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 4
Source File: SimpleDialog.java    From material with 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 File: HistoryData.java    From data-mediator with 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 6
Source File: ClassCaller.java    From AppOpsX with 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 7
Source File: LogItem.java    From bitmask_android with 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 8
Source File: TestUtilities.java    From android-nfc-lib with 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 9
Source File: VpnStatus.java    From android with 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 10
Source File: MethodInvocation.java    From island with 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 11
Source File: LogItem.java    From EasyVPN-Free with 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 12
Source File: SystemServiceCaller.java    From AppOpsX with 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 13
Source File: LogItem.java    From Cake-VPN with 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 14
Source File: LogItem.java    From Cybernet-VPN with 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 15
Source File: TicketRangeParcel.java    From alpha-wallet-android with 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 16
Source File: Ticket.java    From alpha-wallet-android with 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 17
Source File: ERC721Ticket.java    From alpha-wallet-android with 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 18
Source File: LogItem.java    From SimpleOpenVpn-Android with 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 19
Source File: ParcelableResult.java    From android-test with Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel out, int flags) {
  out.writeArray(failures.toArray());
}