Fix leeking of broadcastreceiver by registering in onResume and unregistering in onPause