register For Intent Broadcast - Android Intent

Android examples for Intent:Broadcast

Description

register For Intent Broadcast

Demo Code


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

import android.content.IntentFilter;

public class Main {
    public static BroadcastReceiver registerForBroadcast(String filter,
            Context context, BroadcastReceiver receiver) {
        IntentFilter intentFilter = new IntentFilter(filter);
        context.registerReceiver(receiver, intentFilter);
        return receiver;
    }//from  www.ja v a 2s  .  co m
}

Related Tutorials