Example usage for android.app PendingIntent getClass

List of usage examples for android.app PendingIntent getClass

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.bluelinelabs.logansquare.typeconverters.PendingIntentConverter.java

@Nullable
private Intent getIntent(PendingIntent pintent) {
    Intent intent = null;// w  w  w .ja  va 2  s.  c om
    try {
        Method getIntentMethod = pintent.getClass().getMethod("getIntent");
        intent = (Intent) getIntentMethod.invoke(pintent);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    return intent;
}

From source file:com.bluelinelabs.logansquare.typeconverters.PendingIntentConverter.java

private boolean isActivity(PendingIntent pintent) {
    boolean isActivity = false;
    try {/*  www . j  av a  2 s .c  o m*/
        Method isActivityMethod = pintent.getClass().getMethod("isActivity");
        isActivity = (boolean) isActivityMethod.invoke(pintent);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    return isActivity;
}