I want the user to accept my application rules and terms policy to run my app. I've thought using SharedPreferences. But what is the best way to prompt user , who has just launched my app , to accept the rules?Create a new activity which always checks in the sharedPreferences and if the variable is not set to true it will not let the app begin(It will not launch Main Activity maybe?)?Can you help me with the code?I'm not experienced with using SharedPreferences.
Asked
Active
Viewed 59 times
0
-
This might help you: http://stackoverflow.com/questions/8184597/how-do-i-make-a-portion-of-a-checkboxs-text-clickable – MahdeTo Feb 01 '17 at 20:36
-
1Have a splash screen in your app. Let the splash screen decide whether to show you apps home screen or the T&C page. Splash screen is another activity that you show transiently while your app is launched. Unfortunately SO community can't help with writing a complete solution until you try it for yourself. Please go through the Shared preference doc. it's nothing but a glorified key value store (think like a Hashmap but persistent and with access rules). – Dibzmania Feb 01 '17 at 23:02
-
@Dibzmania Thank you for your reply. I'm using already a Splash screen. I created a Settings Activity with a ListPreference with "yes" or "no" for rules . I also put code in Splash Activity to check what is the selected value for the rules , so it decides to launch MainActivity or Settings Activity. However I dont know how to edit the design of the Settings Activity , can u help me? I can't even add a button in it. – mitsos Feb 01 '17 at 23:15
-
Do you know how to open the layout file for an activity? – Code-Apprentice Feb 02 '17 at 05:36