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

The following examples show how to use android.os.Parcel#readParcelable() . 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 want to check out the right sidebar which shows the related API usage.
Example 1
public SrcDstPlain createFromParcel(Parcel in) 
{	
	SrcDstPlain res = new SrcDstPlain();
	try
	{
		LocationsManager lm = LocationsManagerBase.getLocationsManager(null, false);
                 int size = in.readInt();
		for(int i=0;i<size;i++)
		{
			Uri u = in.readParcelable(getClass().getClassLoader());
			Location srcLoc = lm!=null ? lm.getLocation(u) : null;
			u = in.readParcelable(getClass().getClassLoader());
			Location dstLoc = Uri.EMPTY.equals(u) ? null : lm != null ? lm.getLocation(u) : null;
			if(srcLoc != null)
				res.add(srcLoc, dstLoc);
		}				    
	}
	catch(Exception e)
	{
		Logger.log(e);					
	}					
	return res;
}
 
Example 2
Source Project: OpenHub   File: Milestone.java    License: GNU General Public License v3.0 6 votes vote down vote up
protected Milestone(Parcel in) {
    this.id = in.readLong();
    this.number = in.readInt();
    this.title = in.readString();
    this.description = in.readString();
    this.creator = in.readParcelable(User.class.getClassLoader());
    this.openIssues = in.readInt();
    this.closedIssues = in.readInt();
    int tmpState = in.readInt();
    this.state = tmpState == -1 ? null : State.values()[tmpState];
    long tmpCreatedAt = in.readLong();
    this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
    long tmpUpdatedAt = in.readLong();
    this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
    long tmpDueOn = in.readLong();
    this.dueOn = tmpDueOn == -1 ? null : new Date(tmpDueOn);
    long tmpClosedAt = in.readLong();
    this.closedAt = tmpClosedAt == -1 ? null : new Date(tmpClosedAt);
}
 
Example 3
Source Project: mytracks   File: SendRequest.java    License: Apache License 2.0 6 votes vote down vote up
private SendRequest(Parcel in) {
  trackId = in.readLong();
  sendDrive = in.readByte() == 1;
  sendMaps = in.readByte() == 1;
  sendFusionTables = in.readByte() == 1;
  sendSpreadsheets = in.readByte() == 1;
  driveSync = in.readByte() == 1;
  driveSharePublic = in.readByte() == 1;
  driveShareEmails = in.readString();
  account = in.readParcelable(null);
  driveSuccess = in.readByte() == 1;
  mapsSuccess = in.readByte() == 1;
  fusionTablesSuccess = in.readByte() == 1;
  spreadsheetsSuccess = in.readByte() == 1;
  shareUrl = in.readString();
}
 
Example 4
GuidanceManeuverData(Parcel in) {
    mIconId = in.readInt();
    if (in.readByte() == 0) {
        mDistance = null;
    } else {
        mDistance = in.readLong();
    }
    mInfo1 = in.readString();
    mInfo2 = in.readString();
    mNextRoadIcon = in.readParcelable(Bitmap.class.getClassLoader());
}
 
Example 5
Source Project: material   File: Dialog.java    License: Apache License 2.0 5 votes vote down vote up
protected Builder(Parcel in) {
    mStyleId = in.readInt();
    mContentViewId = in.readInt();
    mTitle = (CharSequence)in.readParcelable(null);
    mPositive = (CharSequence)in.readParcelable(null);
    mNegative = (CharSequence)in.readParcelable(null);
    mNeutral = (CharSequence)in.readParcelable(null);

    onReadFromParcel(in);
}
 
Example 6
Source Project: FilePicker   File: EssFile.java    License: MIT License 5 votes vote down vote up
protected EssFile(Parcel in) {
    mFilePath = in.readString();
    mimeType = in.readString();
    childFolderCount = in.readString();
    childFileCount = in.readString();
    isChecked = in.readByte() != 0;
    isExits = in.readByte() != 0;
    isDirectory = in.readByte() != 0;
    isFile = in.readByte() != 0;
    mFileName = in.readString();
    uri = in.readParcelable(Uri.class.getClassLoader());
    itemType = in.readInt();
}
 
Example 7
Source Project: SnackBar   File: Snack.java    License: Apache License 2.0 5 votes vote down vote up
Snack(Parcel p) {
    mMessage = p.readString();
    mActionMessage = p.readString();
    mActionIcon = p.readInt();
    mToken = p.readParcelable(p.getClass().getClassLoader());
    mDuration = (short) p.readInt();
    mBtnTextColor = p.readParcelable(p.getClass().getClassLoader());
    mBackgroundColor = p.readParcelable(p.getClass().getClassLoader());
    mHeight = p.readInt();
    mTypeface = (Typeface) p.readValue(p.getClass().getClassLoader());
}
 
Example 8
SavedState(Parcel in, ClassLoader loader) {
    super(in);
    if (loader == null) {
        loader = getClass().getClassLoader();
    }
    position = in.readInt();
    adapterState = in.readParcelable(loader);
    this.loader = loader;
}
 
Example 9
private ResourceGroup(Parcel in) {
    super(in);
    mChildrenLoaded = in.readByte() == 1;
    mChildren = new ArrayList<>();
    int count = in.readInt();

    for (int i = 0; i < count; i++) {
        int type = in.readInt();
        switch (type) {
            case Connection.NGWResourceTypeResourceGroup:
                ResourceGroup resourceGroup = in.readParcelable(ResourceGroup.class.getClassLoader());
                resourceGroup.setParent(this);
                mChildren.add(resourceGroup);
                break;
            case Connection.NGWResourceTypePostgisLayer:
                if (mConnection.getNgwVersionMajor() < Constants.NGW_v3)
                    break;
            case Connection.NGWResourceTypeRasterLayer:
            case Connection.NGWResourceTypeVectorLayer:
            case Connection.NGWResourceTypeWMSClient:
                LayerWithStyles layer = in.readParcelable(LayerWithStyles.class.getClassLoader());
                layer.setParent(this);
                mChildren.add(layer);
                break;
            case Connection.NGWResourceTypeLookupTable:
                ResourceWithoutChildren resourceWoChildren = in.readParcelable(ResourceWithoutChildren.class.getClassLoader());
                resourceWoChildren.setParent(this);
                mChildren.add(resourceWoChildren);
            case Connection.NGWResourceTypeWebMap:
                WebMap webMap = in.readParcelable(WebMap.class.getClassLoader());
                webMap.setParent(this);
                mChildren.add(webMap);
                break;
        }
    }
}
 
Example 10
protected AppUpdateStatus(Parcel in) {
    app = in.readParcelable(getClass().getClassLoader());
    apk = in.readParcelable(getClass().getClassLoader());
    intent = in.readParcelable(getClass().getClassLoader());
    status = (Status) in.readSerializable();
    progressCurrent = in.readLong();
    progressMax = in.readLong();
    errorText = in.readString();
}
 
Example 11
protected SavedCardDrawableFragmentItem(final Parcel in) {
    super(in);
    paymentMethodId = in.readString();
    card = in.readParcelable(CardDrawerConfiguration.class.getClassLoader());
}
 
Example 12
private SavedState(Parcel in) {
    super(in);
    preferences = in.readParcelable(Preferences.class.getClassLoader());
}
 
Example 13
Source Project: MicroReader   File: WeiboVideoMBlog.java    License: MIT License 4 votes vote down vote up
protected WeiboVideoMBlog(Parcel in) {
    createTime = in.readString();
    text = in.readString();
    mPageInfo = in.readParcelable(WeiboVideoPageInfo.class.getClassLoader());
    mBlog = in.readParcelable(WeiboVideoMBlog.class.getClassLoader());
}
 
Example 14
Source Project: GoogleDirectionLibrary   File: Bound.java    License: Apache License 2.0 4 votes vote down vote up
protected Bound(Parcel in) {
    northeast = in.readParcelable(Coordination.class.getClassLoader());
    southwest = in.readParcelable(Coordination.class.getClassLoader());
}
 
Example 15
protected EDSLocationFormatterBase(Parcel in)
{
	_disableDefaultSettings = in.readByte() != 0;
	_password = in.readParcelable(ClassLoader.getSystemClassLoader());
}
 
Example 16
@Override
public ConfigNetworkTransmitStatus createFromParcel(Parcel in) {
    final AccessMessage message = in.readParcelable(AccessMessage.class.getClassLoader());
    //noinspection ConstantConditions
    return new ConfigNetworkTransmitStatus(message);
}
 
Example 17
private AlertEvaluationCondition(Parcel parcel) {
    this.threshold = parcel.readDouble();
    this.type = parcel.readParcelable(AlertType.class.getClassLoader());
}
 
Example 18
protected StopPoint(Parcel in) {
    location = in.readParcelable(Coordination.class.getClassLoader());
    name = in.readString();
}
 
Example 19
Source Project: Loop   File: Metadata.java    License: Apache License 2.0 4 votes vote down vote up
protected Metadata(Parcel in) {
    this.connections = in.readParcelable(Connections.class.getClassLoader());
    this.interactions = in.readParcelable(Interactions.class.getClassLoader());
}
 
Example 20
@Override
public ScanFilterCompat createFromParcel(Parcel in) {
    Builder builder = new Builder();
    if (in.readInt() == 1) {
        builder.setDeviceName(in.readString());
    }
    if (in.readInt() == 1) {
        builder.setDeviceAddress(in.readString());
    }
    if (in.readInt() == 1) {
        ParcelUuid uuid = in.readParcelable(ParcelUuid.class.getClassLoader());
        builder.setServiceUuid(uuid);
        if (in.readInt() == 1) {
            ParcelUuid uuidMask = in.readParcelable(
                    ParcelUuid.class.getClassLoader());
            builder.setServiceUuid(uuid, uuidMask);
        }
    }
    if (in.readInt() == 1) {
        ParcelUuid servcieDataUuid =
                in.readParcelable(ParcelUuid.class.getClassLoader());
        if (in.readInt() == 1) {
            int serviceDataLength = in.readInt();
            byte[] serviceData = new byte[serviceDataLength];
            in.readByteArray(serviceData);
            if (in.readInt() == 0) {
                builder.setServiceData(servcieDataUuid, serviceData);
            }
            else {
                int serviceDataMaskLength = in.readInt();
                byte[] serviceDataMask = new byte[serviceDataMaskLength];
                in.readByteArray(serviceDataMask);
                builder.setServiceData(
                        servcieDataUuid, serviceData, serviceDataMask);
            }
        }
    }

    int manufacturerId = in.readInt();
    if (in.readInt() == 1) {
        int manufacturerDataLength = in.readInt();
        byte[] manufacturerData = new byte[manufacturerDataLength];
        in.readByteArray(manufacturerData);
        if (in.readInt() == 0) {
            builder.setManufacturerData(manufacturerId, manufacturerData);
        }
        else {
            int manufacturerDataMaskLength = in.readInt();
            byte[] manufacturerDataMask = new byte[manufacturerDataMaskLength];
            in.readByteArray(manufacturerDataMask);
            builder.setManufacturerData(manufacturerId, manufacturerData,
                    manufacturerDataMask);
        }
    }

    return builder.build();
}