1. Home > programming >

AndroidBroadcastReceiver broadcast simple to use

The examples in this article share the specific code used by Android BroadcastReceiver for your reference. The specific content is as follows

Static BroadcastReceiver

Main code

 public class MyReceiver extends BroadcastReceiver {@Override //Callback when receiving broadcast public void onReceive(Context context, Intent intent) {//Receiving broadcast if(intent !=  null){ //What broadcast is received String action = intent.getAction(); Log.e("Test",action);}} }

This article is published by www.internetweblist.com and does not represent the position of www.internetweblist.com/:http://www.internetweblist.com/programming/82401.html

Contact Us

Online consultation:click here to give a message