本文介绍了在eclipse中加载另一个活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是java的新手,如果有人可以帮助我,我真的很感激。我的问题是如何或何时可以在计时器失效后插入代码来调用或启动另一个活动。



I am new with java and if somebody can help me with this i really appreciate. My question is how or when can i insert a code to call or launch another activity after the timer lapsed.

protected static final Thread This = null;

@Override
protected void onCreate(Bundle hard) {
    // TODO Auto-generated method stub
    super.onCreate(hard);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.activity_main);
    Thread timer = new Thread(){
        public void run(){
            try{
                Thread.sleep(5000);

            }catch(InterruptedException e){
                e.printStackTrace();
            }finally{
                Intent openStartingPoint = new Intent("--.---.---.------.MainActivity");
                startActivity(openStartingPoint);
            }
        }
    };
    timer.start();

}

推荐答案


这篇关于在eclipse中加载另一个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 23:08