Example usage for android.app PendingIntent CREATOR

List of usage examples for android.app PendingIntent CREATOR

Introduction

In this page you can find the example usage for android.app PendingIntent CREATOR.

Prototype

Parcelable.Creator CREATOR

To view the source code for android.app PendingIntent CREATOR.

Click Source Link

Usage

From source file:com.oasisfeng.nevo.decorators.media.MediaPlayerDecorator.java

/** Tiny hack to convert IntentSender to PendingIntent */
PendingIntent getPendingIntent(final IntentSender sender) {
    final Parcel parcel = Parcel.obtain();
    try {/* www  .  j av a 2  s. c  o m*/
        parcel.setDataPosition(0);
        sender.writeToParcel(parcel, 0);
        parcel.setDataPosition(0);
        return PendingIntent.CREATOR.createFromParcel(parcel);
    } finally {
        parcel.recycle();
    }
}

From source file:android.app.Notification.java

/**
 * Unflatten the notification from a parcel.
 *//*from   w  w  w  . j  a v  a  2 s. 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);
    }
}