Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show a splash screen for 3 seconds on Android?
    primarykey
    data
    text
    <p>I would like the splash image to begin and stay for 3 seconds, and then disappear and continue or be replaced with the rest of the layout in the main.xml.</p> <p>This is my code:</p> <p>Main.java</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); ImageView splash = (ImageView) this.findViewById(R.id.splash); </code></pre> <p>main.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- margin=0px, padding=20px --&gt; &lt;!--textview padding=10dp, textSize=16sp--&gt; &lt;!--px=pixel, dp=density indepen sp=scale indepen fontsize preference --&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;ImageView android:id="@+id/splash" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/splash2"/&gt; &lt;ImageView android:id="@+id/myImageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/bg_main"/&gt; &lt;ImageView android:id="@+id/myImageView0" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/bar_top"/&gt; &lt;!-- &lt;TextView android:id="@+id/textItem" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:paddingTop="10dp" android:paddingLeft="110dp" android:background="#00000000" android:textColor="#ffffffff" android:textSize="22sp" android:text="Find Car" android:enabled="false" &gt; --&gt; &lt;TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;RelativeLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="3dp"&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignBottom = "@android:id/tabcontent" /&gt; &lt;/RelativeLayout&gt; &lt;/TabHost&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload