Example usage for android.content BroadcastReceiver toString

List of usage examples for android.content BroadcastReceiver toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.wahtod.wififixer.utility.BroadcastHelper.java

public static boolean isRegistered(BroadcastReceiver receiver) {
    return getMap().containsKey(receiver.toString());
}

From source file:org.wahtod.wififixer.utility.BroadcastHelper.java

public static void unregisterReceiver(Context c, BroadcastReceiver receiver) {
    String hashString = receiver.toString();
    if (isRegistered(receiver)) {
        try {// w ww .  j  a v a2  s. com
            if (getMap().get(hashString))
                LocalBroadcastManager.getInstance(c).unregisterReceiver(receiver);
            else
                c.unregisterReceiver(receiver);
        } catch (Exception e) {
            e.printStackTrace();
        }
        getMap().remove(hashString);
    }
}

From source file:org.wahtod.wififixer.utility.BroadcastHelper.java

public static void registerReceiver(Context c, BroadcastReceiver receiver, IntentFilter f, boolean local) {
    String hashString = receiver.toString();
    if (!isRegistered(receiver)) {
        try {/*from  ww w. j  a v  a2  s . c om*/
            if (local)
                LocalBroadcastManager.getInstance(c).registerReceiver(receiver, f);
            else
                c.registerReceiver(receiver, f);
        } catch (Exception e) {
            e.printStackTrace();
        }
        getMap().put(hashString, local);
    }
}

From source file:com.cognizant.trumobi.em.Email.java

public static void unregisterCalendarReceiver(BroadcastReceiver receiver) {
    try {//from w w  w . java 2 s .  c om
        appContext.unregisterReceiver(receiver);
    } catch (Exception e) {
        Log.d("Exception while unregistering " + receiver.toString(), e.toString());
    }
}