unRegister Local Receiver in LocalBroadcastManager - Android android.content

Android examples for android.content:BroadcastReceiver

Description

unRegister Local Receiver in LocalBroadcastManager

Demo Code

import android.content.BroadcastReceiver;
import android.content.Context;
import android.support.v4.content.LocalBroadcastManager;

public class Main {

  public static void unRegisterLocalReceiver(Context context, BroadcastReceiver receiver) {
    if (context == null) {
      return;/*from   w  w w  .  j a  v a2s  . com*/
    }

    LocalBroadcastManager manager = LocalBroadcastManager.getInstance(context);
    manager.unregisterReceiver(receiver);
  }

}

Related Tutorials