I need a way to detect the active Activity without pooling.
The right way is to have a Service that listens for Activities launching in a continuous way.
BUT, I do not want to do pooling since it drains the battery.
I have tried READ_LOGS
permission, but it seems that I have to have ROOT access, which I do not have/need.
I am thinking that I need a kind of Broadcast Receiver and listen for Apps changes like this:
ActivityChangerBroadcast extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
try {
} catch (Exception e) {
}
}
}