I want to make an intro for my android application, so i was thinking to do that in this way :
This is my intro.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/logo_inesc" />
</LinearLayout>
And imagine my main.xml with some menus and images.
When the user is starting the app i would like to show him first one image of presentation and then the app itself with options and whatever.
I did this in my activity :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.intro);
try {
Thread.sleep(6000); //Intro image will be shown for 6 seconds
setContentView(R.layout.home);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
I don't know if this is the right procedure to do it, the layouts are changing correctly, but the image is not being showed. Someone knows why?
Regards.