I am developing a very simple flashlight application, while I have successfully achieved what I was looking for, I would like to perform it that way I want it to. Currently my flashlight remains on while my activity is active, as soon as I hit the home button to minimize the activity flashlight turns off. I want the flashlight to stay on and turn off only when I click the turn off button in my activity.
I also want something like that if the flashlight is active and user hits the home button to minimize the activity, Turn Off button to be displayed in the notification bar.
Please guide me.