i want to force use to fill Settings Page in two cases
1) when user first launch Application
2) when database version is change i want that setting page should be filled first before proceding
in my Setting class i set shared preferences “false” , and then i check it in below code
class setting //main class
String flag = sharedPreferences.getString(“CreatedFlag”,””);
if(flag.equals("true"))
{
// Move to second activity
Intent i =new Intent();
i.setClass(someclass.this,otherPage.class );
startActivity(i);
finish();
}
else
{ // Stay on Settings page }
Problem : it run fine when user first launch application ,it show setting page and fill tht page ,
but when user run application second time it show setting page again ,coz shared preference still have true value ,
thn again user run app 3rd time Shared Preference have update value which is false ,and show other page
what i want is tht Setting page show only once if its there is no setting define ,other wise it goes to home page
need help ,
I dont shee here where you’re actually saving the preferences, I assume its in the otherPage activity??
If not add this to the first activity
Then on your settings page:
After the first run, the shared prefs file will be persisted, and then should not goto the settings page the second time its run.