I want a notification to pop up when an app opens. But once User dismisses, I don’t want it to come back again, even if they go back to the same activity. But when the app exits, and they come back later, I want same dialog notification to pop up (prompting user to login).
So basically…
boolean b = true;
if (b == true) {
// show dialog
b = false;
}
I simply want var b to save state but clear on exit.
I’m not sure there’s a point to using sharedpreference if you don’t want the value to persist across your app being closed, as that’s kind of the point of them.
Perhaps just using a boolean in your Application class would be better? It will be persistent until the app is completely shutdown.