I'm trying to make a webview application, and I'm stuck somewhere.
When I start the application first time (for installation) it should ask a question, like:
Have you read the terms of service? Yes No
If I choose "Yes", the app should remember it, and shouldn't ask again if the program is launched again sometime later. If I choose "No", the application should terminate, and it should ask the same question next time the application has been started.
I'm really stuck, and I couldn't find a tutorial like this.
I would create a loading activity that would check to see if its asked the user to accept the rights (TOS) and then if it has go into the main activity, and if not display it and wait. Try this in oncreate of the loading activity
Then create a listener for the yes/no button that calls these methods
What this is doing is when the app loads it tries to get the SharedPreference "accepted". If it can't find it then it uses the default value of false hence (sp.getBoolean("accepted", false"). Then if the user accepts the tos you store the SharedPreference of "accepted" as true. So next time the app loads it will be able to find the preference and return true, therefore not displaying the TOS