开发者

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

开发者 https://www.devze.com 2023-02-11 21:17 出处:网络
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)

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

精彩评论

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

关注公众号