Example usage for android.os Parcel writeStringList

List of usage examples for android.os Parcel writeStringList

Introduction

In this page you can find the example usage for android.os Parcel writeStringList.

Prototype

public final void writeStringList(List<String> val) 

Source Link

Document

Flatten a List containing String objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed.

Usage

From source file:com.artemchep.horario.database.models.SubjectGroup.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(key);//w w  w  .jav a  2s .c  o  m
    dest.writeString(name);
    dest.writeStringList(users);
}

From source file:com.tigerpenguin.places.model.Photo.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(photoReference);//  ww  w  .j a  va  2s .  c  o  m
    dest.writeInt(height);
    dest.writeInt(width);
    dest.writeStringList(htmlAttributions);
}

From source file:at.bitfire.davdroid.resource.LocalGroup.java

@Override
protected ContentValues contentValues() {
    ContentValues values = super.contentValues();

    @Cleanup("recycle")
    Parcel members = Parcel.obtain();//from w w w . j  av  a2 s  . c  o  m
    members.writeStringList(contact.members);
    values.put(COLUMN_PENDING_MEMBERS, members.marshall());

    return values;
}

From source file:com.artemchep.horario.database.models.Note.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(key);//from   ww  w.  j  a v a 2 s. co m
    dest.writeString(title);
    dest.writeString(content);
    dest.writeString(contentHtml);
    dest.writeString(priority);
    dest.writeStringList(subjects);
    dest.writeInt(due);
}

From source file:org.sufficientlysecure.keychain.ui.MultiUserIdsFragment.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {

    MatrixCursor matrix = new MatrixCursor(new String[] { "_id", "user_data", "grouped" }) {
        @Override/*from  w ww .  j av  a  2s .  c  o m*/
        public byte[] getBlob(int column) {
            return super.getBlob(column);
        }
    };
    data.moveToFirst();

    long lastMasterKeyId = 0;
    String lastName = "";
    ArrayList<String> uids = new ArrayList<>();

    boolean header = true;

    // Iterate over all rows
    while (!data.isAfterLast()) {
        long masterKeyId = data.getLong(INDEX_MASTER_KEY_ID);
        String userId = data.getString(INDEX_USER_ID);
        OpenPgpUtils.UserId pieces = KeyRing.splitUserId(userId);

        // Two cases:

        boolean grouped = masterKeyId == lastMasterKeyId;
        boolean subGrouped = data.isFirst() || grouped && lastName.equals(pieces.name);
        // Remember for next loop
        lastName = pieces.name;

        Log.d(Constants.TAG, Long.toString(masterKeyId, 16) + (grouped ? "grouped" : "not grouped"));

        if (!subGrouped) {
            // 1. This name should NOT be grouped with the previous, so we flush the buffer

            Parcel p = Parcel.obtain();
            p.writeStringList(uids);
            byte[] d = p.marshall();
            p.recycle();

            matrix.addRow(new Object[] { lastMasterKeyId, d, header ? 1 : 0 });
            // indicate that we have a header for this masterKeyId
            header = false;

            // Now clear the buffer, and add the new user id, for the next round
            uids.clear();

        }

        // 2. This name should be grouped with the previous, just add to buffer
        uids.add(userId);
        lastMasterKeyId = masterKeyId;

        // If this one wasn't grouped, the next one's gotta be a header
        if (!grouped) {
            header = true;
        }

        // Regardless of the outcome, move to next entry
        data.moveToNext();

    }

    // If there is anything left in the buffer, flush it one last time
    if (!uids.isEmpty()) {

        Parcel p = Parcel.obtain();
        p.writeStringList(uids);
        byte[] d = p.marshall();
        p.recycle();

        matrix.addRow(new Object[] { lastMasterKeyId, d, header ? 1 : 0 });

    }

    mUserIdsAdapter.swapCursor(matrix);
}

From source file:edu.umich.flowfence.common.QMDescriptor.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(kind);//from  w ww . j av a2s. com
    definingClass.writeToParcel(dest, flags);
    dest.writeString(methodName);
    dest.writeStringList(paramTypes);
}

From source file:com.nestapi.lib.API.Structure.java

/** {@inheritDoc} */
@Override// w ww  .ja v a  2s  . co  m
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mStructureID);
    dest.writeStringList(mThermostatIDs);
    dest.writeStringList(mSmokeCOAlarms);
    dest.writeString(mName);
    dest.writeString(mCountryCode);
    dest.writeString(mPeakPeriodStartTime);
    dest.writeString(mPeakPeriodEndTime);
    dest.writeString(mTimeZone);
    dest.writeSerializable(mAwayState);
    dest.writeParcelable(mETA, 0);
}

From source file:com.nestlabs.sdk.Structure.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mStructureId);/*from w  ww . j a  va2 s .c  o m*/
    dest.writeStringList(mThermostats);
    dest.writeStringList(mSmokeCoAlarms);
    dest.writeStringList(mCameras);
    dest.writeMap(mDevices);
    dest.writeString(mAway);
    dest.writeString(mName);
    dest.writeString(mCountryCode);
    dest.writeString(mPostalCode);
    dest.writeString(mPeakPeriodStartTime);
    dest.writeString(mPeakPeriodEndTime);
    dest.writeString(mTimeZone);
    dest.writeParcelable(mEta, flags);
    Utils.writeBoolean(dest, mRhrEnrollment);
    dest.writeMap(mWheres);
}

From source file:com.facebook.AccessToken.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(expires.getTime());/*from  w w  w  .  j  a  v a  2 s  .c o  m*/
    dest.writeStringList(new ArrayList<String>(permissions));
    dest.writeStringList(new ArrayList<String>(declinedPermissions));
    dest.writeString(token);
    dest.writeString(source.name());
    dest.writeLong(lastRefresh.getTime());
    dest.writeString(applicationId);
    dest.writeString(userId);
}

From source file:com.markupartist.sthlmtraveling.provider.planner.JourneyQuery.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(origin, 0);/*  w ww.j  a va2 s.c o m*/
    dest.writeParcelable(destination, 0);
    dest.writeParcelable(via, 0);
    dest.writeString(time.format2445());
    dest.writeInt(isTimeDeparture ? 1 : 0);
    dest.writeInt(alternativeStops ? 1 : 0);
    dest.writeStringList(transportModes);
    dest.writeString(ident);
    dest.writeString(seqnr);
}