unRegister Intent Local Receiver - Android Intent

Android examples for Intent:Broadcast

Description

unRegister Intent Local Receiver

Demo Code


//package com.java2s;

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 ww  .j  a v a2s.  c o m*/

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

Related Tutorials