Creating the Broadcast Receiver

A broadcast receiver is implemented as a subclass of BroadcastReceiver class and overriding the onReceive() method where each message is received as a Intent object parameter.


public class MyReceiver extends BroadcastReceiver {

@Override

public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Intent Detected.",

Toast.LENGTH_LONG).show();
}

}

It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someoneBuffer this pageDigg thisFlattr the authorShare on StumbleUponPin on PinterestShare on YummlyShare on VKShare on RedditPrint this pageShare on Tumblr
Related Posts

Add a Comment

Your email address will not be published. Required fields are marked *