Code examples using Context.registerReceiver. Snippets selected and curated by Codota - Find The Right Code I want to use dynamically registered BroadcastReceiver that has a reference to an Activity so it can modify its UI. I am using Context.registerReceiver() method but. Android BroadcastReceiver - Tutorial. Lars Vogel (c). You can also register and unregister a receiver at runtime via the Context.registerReceiver(). The Intent filters used in registerReceiver(BroadcastReceiver, IntentFilter) and in application manifests are not guaranteed to be exclusive. I have a service that can be started and stopped from a button. But within the service I want to register a reciever to listen for SMS broadcasts. I only want the. registerReceiver(BroadcastReceiver,intentFilter); 一般：在onStart中注册，onStop中取消unregisterReceiver 指定广播目标Action ：Intent. 版权声明：本文为博主原创文章，未经博主允许不得转载。 前面我们介绍了Android系统的广播机制，从本质来说，它是. Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main. ( BluetoothReceiver , onReceive ); ; registerReceiver(receiver, new IntentFilter(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED));. registerReceiver(BroadcastReceiver receiver, IntentFilter filter. This Context is the same as what the named application gets when it is launched.