Example usage for android.content BroadcastReceiver getClass

List of usage examples for android.content BroadcastReceiver getClass

Introduction

In this page you can find the example usage for android.content BroadcastReceiver getClass.

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.woodblockwithoutco.quickcontroldock.util.ReceiverUtil.java

public static void unregisterReceiverSafe(Context context, BroadcastReceiver receiver) {
    try {/*from  ww  w . j  ava  2s  .  com*/
        context.unregisterReceiver(receiver);
    } catch (IllegalArgumentException e) {
        Log.e(TAG, "Caught attempt to unregister inactive BroadcastReceiver [" + receiver.getClass().getName()
                + "]");
    }
}

From source file:com.woodblockwithoutco.quickcontroldock.util.ReceiverUtil.java

public static void unregisterLocalReceiverSafe(Context context, BroadcastReceiver receiver) {
    try {//from  w  w w  .j ava 2  s  . com
        LocalBroadcastManager.getInstance(context).unregisterReceiver(receiver);
    } catch (IllegalArgumentException e) {
        Log.e(TAG, "Caught attempt to unregister inactive local BroadcastReceiver ["
                + receiver.getClass().getName() + "]");
    }
}