android - How to set delay between main activity and a new activity -


i want welcome screen appear , after delay of few seconds start new activity. ex. have mainactivity.java , second activity.java. main activity displays welcome message , second activity work. using intent start second activity main. main not start instead directly second loaded. help!!!

use handler example

private handler handler; private runnable delayrunnable;  handler = new handler(); delayrunnable = new runnable() {       @override      public void run() {     // todo auto-generated method stub               add intent here second activity            intent = new intent(getapplicationcontext(), secondactivity.class);              startactivity(i);     } };       handler.postdelayed(delayrunnable, 3000); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -