0

I have broadcastReceiver defined in AndroidManifest.xml. Do I need to unregisterReceiver in activity's onDestroy and onPause? If yes, how to do it? Note that I didn't registerReceiver by code. Just defined in the AndroidManifest.xml. If required , then how to register again onStart and onResume?

  <receiver android:name="com.me.broadcastReceiver.test" >
        <intent-filter>
            <action android:name="abc" />
        </intent-filter>
    </receiver>
masiboo
  • 4,537
  • 9
  • 75
  • 136
  • What is the Broadcastreceiver doing..It would depend on the requirement of the receiver. If you want the receiver to stop working after user closes the app then you would want to unregister. If you want the app to work in background even if the app is closed you need not unregister. – Psypher Jun 30 '15 at 14:16

1 Answers1

0

Nope, you do not need to unregister your receiver if it is declared in the manifest.

You can still disable it if you want (for example check this answer).

Community
  • 1
  • 1
Sassa
  • 3,294
  • 2
  • 28
  • 42