Example usage for android.net Uri CREATOR

List of usage examples for android.net Uri CREATOR

Introduction

In this page you can find the example usage for android.net Uri CREATOR.

Prototype

Parcelable.Creator CREATOR

To view the source code for android.net Uri CREATOR.

Click Source Link

Document

Reads Uris from Parcels.

Usage

From source file:com.google.android.gms.games.C0075a.java

public GameEntity m148t(Parcel parcel) {
    int j = C0065a.m92j(parcel);
    int i = 0;//from   w  w  w.j av  a2  s  .com
    String str = null;
    String str2 = null;
    String str3 = null;
    String str4 = null;
    String str5 = null;
    String str6 = null;
    Uri uri = null;
    Uri uri2 = null;
    Uri uri3 = null;
    boolean z = false;
    boolean z2 = false;
    String str7 = null;
    int i2 = 0;
    int i3 = 0;
    int i4 = 0;
    while (parcel.dataPosition() < j) {
        int i5 = C0065a.m90i(parcel);
        switch (C0065a.m107y(i5)) {
        case DetectedActivity.ON_BICYCLE /*1*/:
            str = C0065a.m94l(parcel, i5);
            break;
        case DetectedActivity.ON_FOOT /*2*/:
            str2 = C0065a.m94l(parcel, i5);
            break;
        case DetectedActivity.STILL /*3*/:
            str3 = C0065a.m94l(parcel, i5);
            break;
        case DetectedActivity.UNKNOWN /*4*/:
            str4 = C0065a.m94l(parcel, i5);
            break;
        case DetectedActivity.TILTING /*5*/:
            str5 = C0065a.m94l(parcel, i5);
            break;
        case GamesClient.STATUS_NETWORK_ERROR_OPERATION_FAILED /*6*/:
            str6 = C0065a.m94l(parcel, i5);
            break;
        case GamesClient.STATUS_LICENSE_CHECK_FAILED /*7*/:
            uri = (Uri) C0065a.m77a(parcel, i5, Uri.CREATOR);
            break;
        case GamesClient.STATUS_APP_MISCONFIGURED /*8*/:
            uri2 = (Uri) C0065a.m77a(parcel, i5, Uri.CREATOR);
            break;
        case ConnectionResult.SERVICE_INVALID /*9*/:
            uri3 = (Uri) C0065a.m77a(parcel, i5, Uri.CREATOR);
            break;
        case ConnectionResult.DEVELOPER_ERROR /*10*/:
            z = C0065a.m83c(parcel, i5);
            break;
        case ConnectionResult.LICENSE_CHECK_FAILED /*11*/:
            z2 = C0065a.m83c(parcel, i5);
            break;
        case ConnectionResult.DATE_INVALID /*12*/:
            str7 = C0065a.m94l(parcel, i5);
            break;
        case C0048R.styleable.MapAttrs_zOrderOnTop /*13*/:
            i2 = C0065a.m86f(parcel, i5);
            break;
        case 14:
            i3 = C0065a.m86f(parcel, i5);
            break;
        case ViewDragHelper.EDGE_ALL /*15*/:
            i4 = C0065a.m86f(parcel, i5);
            break;
        case LocationStatusCodes.GEOFENCE_NOT_AVAILABLE /*1000*/:
            i = C0065a.m86f(parcel, i5);
            break;
        default:
            C0065a.m80b(parcel, i5);
            break;
        }
    }
    if (parcel.dataPosition() == j) {
        return new GameEntity(i, str, str2, str3, str4, str5, str6, uri, uri2, uri3, z, z2, str7, i2, i3, i4);
    }
    throw new C0064a("Overread allowed size end=" + j, parcel);
}

From source file:org.jraf.android.dcn.wearable.app.notif.NotificationWearableListenerService.java

@Override
public void onDataChanged(DataEventBuffer dataEvents) {
    Log.d("count=" + dataEvents.getCount());
    // There should always be only one item, but we iterate to be safe
    for (DataEvent dataEvent : dataEvents) {
        DataItem dataItem = dataEvent.getDataItem();
        Uri uri = dataItem.getUri();/*from  w ww  . j  av  a2 s . c  om*/
        Log.d("uri=" + uri);
        String path = uri.getPath();
        Log.d("path=" + path);
        int type = dataEvent.getType();
        Log.d("type=" + LogUtil.getConstantName(DataEvent.class, type, "TYPE_"));
        if (type == DataEvent.TYPE_DELETED) {
            dismissNotification();
        } else {
            DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
            DataMap dataMap = dataMapItem.getDataMap();
            String title = dataMap.getString(WearHelper.EXTRA_TITLE);
            String textShort = dataMap.getString(WearHelper.EXTRA_TEXT_SHORT);
            String textLong = dataMap.getString(WearHelper.EXTRA_TEXT_LONG);
            Asset photoAsset = dataMap.getAsset(WearHelper.EXTRA_PHOTO);
            Bitmap photo = null;
            if (photoAsset != null) {
                // Blocking
                mWearHelper.connect(this);
                photo = mWearHelper.loadBitmapFromAsset(photoAsset);
            }
            byte[] contactUriBytes = dataMap.getByteArray(WearHelper.EXTRA_CONTACT_URI);
            Uri contactUri = ParcelableUtil.unparcel(contactUriBytes, Uri.CREATOR);
            String phoneNumber = dataMap.getString(WearHelper.EXTRA_PHONE_NUMBER);

            showNotification(title, textShort, textLong, photo, contactUri, phoneNumber);
        }
    }
}

From source file:android.app.Notification.java

/**
 * Unflatten the notification from a parcel.
 *//*from   w w  w  . j a v a  2s .c  o  m*/
public Notification(Parcel parcel) {
    int version = parcel.readInt();

    when = parcel.readLong();
    icon = parcel.readInt();
    number = parcel.readInt();
    if (parcel.readInt() != 0) {
        contentIntent = PendingIntent.CREATOR.createFromParcel(parcel);
    }
    if (parcel.readInt() != 0) {
        deleteIntent = PendingIntent.CREATOR.createFromParcel(parcel);
    }
    if (parcel.readInt() != 0) {
        tickerText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
    }
    if (parcel.readInt() != 0) {
        tickerView = RemoteViews.CREATOR.createFromParcel(parcel);
    }
    if (parcel.readInt() != 0) {
        contentView = RemoteViews.CREATOR.createFromParcel(parcel);
    }
    if (parcel.readInt() != 0) {
        largeIcon = Bitmap.CREATOR.createFromParcel(parcel);
    }
    defaults = parcel.readInt();
    flags = parcel.readInt();
    if (parcel.readInt() != 0) {
        sound = Uri.CREATOR.createFromParcel(parcel);
    }

    audioStreamType = parcel.readInt();
    vibrate = parcel.createLongArray();
    ledARGB = parcel.readInt();
    ledOnMS = parcel.readInt();
    ledOffMS = parcel.readInt();
    iconLevel = parcel.readInt();

    if (parcel.readInt() != 0) {
        fullScreenIntent = PendingIntent.CREATOR.createFromParcel(parcel);
    }

    priority = parcel.readInt();

    kind = parcel.createStringArray(); // may set kind to null

    if (parcel.readInt() != 0) {
        extras = parcel.readBundle();
    }

    actions = parcel.createTypedArray(Action.CREATOR);
    if (parcel.readInt() != 0) {
        bigContentView = RemoteViews.CREATOR.createFromParcel(parcel);
    }
}