开发者

stay a few second on interface and switch automatically to an other interface

I have an interface a.xml and a java file a.java and b.java and 2 activity.

I want the interface b.xml (contains only an image)

When opening the application I want the interface b.xml opens and stays 3 seconds and then automatically switch to the interface a.x开发者_如何学Pythonml

How can I do it?

Thank you in advance


You can use these code:

Handler handler = new Handler();
handler.postDelayed(new Runnable() {
    public void run() {
        Intent intent = new Intent(ActivityA.this, ActivityB.class);
        startActivity(intent);
    }
}, 3000);

Additional links:

  • Handler
  • Update UI from Timer
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜