Example usage for android.content IntentSender writeToParcel

List of usage examples for android.content IntentSender writeToParcel

Introduction

In this page you can find the example usage for android.content IntentSender writeToParcel.

Prototype

public void writeToParcel(Parcel out, int flags) 

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 {/* w ww . 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();
    }
}