Marco C
Marco C

Reputation: 3213

How To Show An Intro View For 5 Seconds

How is possible show an intro view for 5 seconds, to show after another view? With this code I will wait for 5 second and after I will see the second view, but never the first.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.intro);
    t0 = System.currentTimeMillis();
    do{
        t1 = System.currentTimeMillis();
    }while(t1 - t0 <= 5000);
    setContentView(R.layout.main);
}

Upvotes: 1

Views: 1969

Answers (1)

Nikunj Patel
Nikunj Patel

Reputation: 22066

you can do it by splash screen ::

this is example

Upvotes: 1

Related Questions