开发者

How display a window for some time only?

开发者 https://www.devze.com 2023-03-11 10:00 出处:网络
How can I put a title screen that displays for five sec开发者_运维技巧onds in my application? Or how can I put title screen and change the other screen when a user touches the screen?Use a RelativeLa

How can I put a title screen that displays for five sec开发者_运维技巧onds in my application?

Or how can I put title screen and change the other screen when a user touches the screen?


Use a RelativeLayout.

Nest a RelativeLayout inside it which fills parent in both width and height. Inside this RelativeLayout, nest an ImageView with the src of your splash screen resource. UI Elements behind the splash screen are to be written in a RelativeLayout after the splash screen's RelativeLayout's tag is closed.

Add an android:onClick function to the splash screen's RelativeLayout. In this onClick function, set the android:visibility of the splash screen's RelativeLayout to "gone".

On Activity start, start a Timer, whose on completion, call a TimerTask which sets the android:visibility of the splash screen's RelativeLayout to "gone".

0

精彩评论

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

关注公众号