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?
You can refer this question How to detect when an Android app goes to the background and come back to the foreground the guy who answered this solved using
onFocuschangeddon't know how much effective is this method,anyway keep researching in google