When to unregister BroadcastReceiver? In onPause(), onDestroy(), or onStop()?
When should I use unregisterReceiver? In onPause() , onDestroy() , or onStop() ? Note: I need the service to run in the background. Update: I get an exception releasing receivers null . Activity has leaked intent receivers are you missing call to unregisterReceiver(); Please tell me if there's something wrong, here's my code: private boolean processedObstacleReceiverStarted; private boolean mainNotificationReceiverStarted; protected void onResume() { super.onResume(); try { registerReceivers(); } catch (Exception e) { Log.e(MatabbatManager.TAG, "MAINActivity: could not register receiver for