I need to turn off Bluetooth when my app "goes to background"/"becomes inactive".
I tried to do it in onPause() of my MainActivity but that doesn't work since now BT goes off (onPause() of the Mainactivity is fired) even when I start a new activity showing an entity detail of chosen item from the Mainactivity.
What I need is some kind of "onPause()" of my App not of a single activity.
I think nothing like this exists so is there any preferable solution?
It is not advisable to use
RunningTaskInfo
because its “method is only intended for debugging and presenting task management user interfaces“. well, if you are developing app for ICS and above I found this link very useful !http://vardhan-justlikethat.blogspot.in/2013/05/android-solution-to-detect-when-android.html