I have an app in which I need to prompt the user to enter the PIN every time the app comes from the background.
I looked several answers from stackoverflow from @hackbod and @commonsware I implemented the timeout approach from @commonsware and it worked fine, but my users are not happy with it. They want to prompt for PIN everytime when the app is coming from background.
Now I am implemeting the solution from @hackbod by having every activity increment the counter in onStart and decrement the count in onStop. Android detecting if an application entered the background
But the problem is when users changes the Orientation of the current activity the counter sets back to 0 and my app thinks the user is coming from background. my onStart() increments the counter and onStop is decrementing the counter. I want android to take care of the orientation change as I have different layouts for different orientation.
I don't want to use GET_TASKS approach for now. All suggestions are appreciated..