0

So far, I have a class which directs a user to a particular class upon completion of the splash screen.

What I'd like is, for the splash screen class to direct users to one class upon primary page load. But if the user revisits the splash screen, I'd like it to direct the user to the most recently used class (other than the splash screen class)

How do this?

The purpose of this, is so if the user moves the application to the background,then when the application is brought to the foreground the user is returned to their most recently opened class after again seeing the splash screen, rather than again sent to the primary class

public class MainSplashScreen extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_splash_screen);  


        new Handler().postDelayed(new Runnable() {

            // Using handler with postDelayed called runnable run method

            @Override
            public void run() {
                Intent i = new Intent(MainSplashScreen.this, FirstScreen.class);
                startActivity(i);

                // close this activity
                finish();
            }
        }, 5*1000); // wait for 5 seconds

    }

    @Override
    protected void onDestroy() {

        super.onDestroy();
  • You're going to show a splash screen everytime the app is displayed? I would uninstall you in minutes. – Simon Nov 11 '14 at 21:07
  • I would like it if the application would only show the splash screen once but the only way I know how to show how to set a splash screen is to set it as the starting class on the Android manifest. Do you know of another methodology which achieved what I'm after or are you just responding to the question just to be negative –  Nov 11 '14 at 22:07

1 Answers1

0

This stuff is your stuff How to hide last activity view in android recent list? Using a locker screen implementation

That way, the activity won't appear in the history and the user will go to the splash only when application is started again and not during restarts.

Community
  • 1
  • 1
eduyayo
  • 2,020
  • 2
  • 15
  • 35