Unregister the BroadcastReceiver with the LocalBroadcastManager for Intent. - Android Intent

Android examples for Intent:Broadcast

Description

Unregister the BroadcastReceiver with the LocalBroadcastManager for Intent.

Demo Code


//package com.java2s;
import android.content.BroadcastReceiver;
import android.content.Context;

import android.support.annotation.NonNull;
import android.support.v4.content.LocalBroadcastManager;

public class Main {
    /**/*from   w w w.ja va  2  s.  c o m*/
     * Unregister the {@link BroadcastReceiver} with the {@link LocalBroadcastManager}.
     *
     * @param context  used to get the instance of the {@link LocalBroadcastManager}.
     * @param receiver to register with the {@link LocalBroadcastManager}.
     */
    public static void unregisterReceiver(@NonNull Context context,
            @NonNull BroadcastReceiver receiver) {
        LocalBroadcastManager.getInstance(context).unregisterReceiver(
                receiver);
    }
}

Related Tutorials