I'm using this code:
Intent i = getApplicationContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
and as far as I understand i
should be null if ACTION_BATTERY_CHANGED didn't occur, but it is never null and always returns me the same data.
It worked fine when I used a broadcast receiver. Do I need to delete the Intent after receiving it?