2

How can I put a title screen that displays for five seconds in my application?

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

inazaruk
  • 74,247
  • 24
  • 188
  • 156
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
  • Is this supposed to be android? – Stefan Kendall Jun 03 '11 at 19:38
  • it is Stefan, sorry by the misunderstanding. – Valter Silva Jun 03 '11 at 19:40
  • An easy way to do this is using FrameLayout and add two LinearLayouts inside it. Start with the "real" one invisible and your splat showing. Then on a click or with a timer you change the visibility on them. This is how I usually do when I need to read alot of data at startup. – H9kDroid Jun 03 '11 at 20:01

1 Answers1

2

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".

Shumon Saha
  • 1,415
  • 6
  • 16
  • 33