`
jiaoronggui
  • 浏览: 1347191 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
博客专栏
B7c2eb31-a8ea-3973-a517-d00141f39b89
项目管理软件-redmin...
浏览量:117228
4a63e153-250f-30f6-a051-97cfc67cb3d3
IT职业规划
浏览量:200666
社区版块
存档分类
最新评论

Another easy way using Timer class to use splash screen

 
阅读更多
public class SplashActivity extends Activity{
    Context context;
    Timer splashTimer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        context= this;
        splashTimer =  new Timer();
        splashTimer.schedule(new TimerTask() {
 
            @Override
            public void run() {
                updateValue();
            }
        }, 1000, 15000);// 1 second for initial start value and 15 seconds to display splash screen
         
    }
    public void updateValue()
    {
         
        Intent intent =  new Intent(context, .class);
        startActivity(intent);
        splashTimer.cancel();
        finish();
    }
 
}

 

from http://www.itcuties.com/android/how-to-create-android-splash-screen/

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics