KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My app has an action bar with 3 fragment tabs. In the second fragment I register and unregister a BroadcastReceiver. I unregister the receiver in onPause and register it in onCreateView and in onResume . getActivity().registerReceiver(this.batteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); and getActivity().unregisterReceiver(batteryInfoReceiver); 1) Is it all right to register the same reciever twice (in onCreateView and onResume)?(is it harmless?) 2) Is it enough to just register the reciever in onResume?
Tags (comma-separated)
Save Edits
Cancel