-
I am creating an app that requires some settings to be set first
before starting the display activity.
I would like the app to check if a preference file (that contains these settings) exists and if it does exist move to a
particular activity or remain in the main activity(as the settings
activity is my main activity). -
I tried to use startactivty() on startup, but it shows the settings
menu for a fraction of a second before moving on to the display
activity. -
how should I do it?
I tried the following code:
super.onCreate(savedInstanceState); setContentView(R.layout.main); SharedPreferences prefsfile = getSharedPreferences("myfile",0); if( prefsfile!=null & Timetablledisplay.flag==0){ Intent i=new Intent(ProjectBunkitActivity.this,Timetablledisplay.class); startActivity(i); }
I am creating an app that requires some settings to be set first before
Share
An option for a potential workaround for this problem would be taking a slightly different approach:
Instead of launching into Settings, and then deciding whether or not to go to the Timetablleddisplay activity, you could start in a blank activity that simply decides which activity to launch.
The activity could be something like this: