BroadcastReceiver with a Listener drains battery when not in use
I have a receiver which waits for TelephonyManager.ACTION_PHONE_STATE_CHANGED : public void onReceive(Context context, Intent intent) { String theAction = intent.getAction(); if (theAction != null && theAction.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) { CONTEXT = context; startListening(); } When it gets it, I register the listener (for orientation sensor): public void startListening() { sensorManager = (SensorManager) CONTEXT.getSystemService(Context.SENSOR_SERVICE); List<Sensor> sensors = sensorManager.getSensorList(Sensor.TYPE_ORIENTATION); if (sensors.size() > 0) { sensor =