How to stop an Activity in android
<p>My code looks as follows..</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    try {
        Thread.sleep(3000);
        } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
     finish();
    }
</code></pre>

<p>And my XML is</p>

<pre><code>&lt;LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_gravity="center"&gt;&lt;Button android:id="@+id/Button01" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:text="Button"
    android:layout_gravity="center"
    android:layout_marginTop="80px"&gt;&lt;/Button&gt;
</code></pre>

<p></p>

<p>In my XML i had a button. Now what i want is After starting the activity i have to wait for 3 seconds and then the Activity has to be stopped..Through my code the Activity is stopped after 3 seconds. But am not seeing any Button when the activity is started..Only Black screen is appearing for 3 seconds..But i also want to display that button..can any one help with sample code..please...I am need of it..</p>
