Application behaves two differnt ways when user chose open and done at the time of instalation in android.so what is the resion?
<p><strong>NOTE: PLEASE DO NOT TEST IT DIRECTLY DEVICE WITH ECLIPSE. PLEASE GENERATE .APK FILE FIRST LATER COPY THAT .APK INTO YOUR DEVICE MEMORY THEN INSTALL FROM THERE</strong> </p>

<p>Application flow </p>

<p>1)open Loading screen(apear 5 sec)----->open News title screen</p>

<p>2)from News screen when user click on back button i override </p>

<pre><code>public void onBackPressed() {
        moveTaskToBack(true);
}
</code></pre>

<p>3)when user again open his application he directly open his news title screen</p>

<p>this is my requirement and i done this successfully when user chose case1 at the time of installation  which is specified in following cases </p>

<p>I build apk then upload it to server. Then on my galaxy 2.2 I type in url in a browser and download apk. After its finished downloading I install it. When Install is finished I have two options</p>

<blockquote>
  <p>Case 1 :- Done</p>
  
  <p>case 2 :- Open</p>
</blockquote>

<p>when I press Open oplication open successfullly first time. when i cick on application again(Second time) it again open Loading screen.</p>

<p>But when I choose Done and later access it through Application menu it works ok! so this choice determines how app behaves later ? why? how? Im puzzled</p>

<p>now i am upload some simple  sample code </p>

<blockquote>
  <p>Activity 1: HelloWorldActivity.java</p>
</blockquote>

<p>this contain simple button named as "first screen"</p>

<pre><code>package com.hb.Screens;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class HelloWorldActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button tv=(Button) findViewById(R.id.btn);
        tv.setText("First screen");
        tv.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                startActivity(new Intent(HelloWorldActivity.this, secondScreen.class));
                HelloWorldActivity.this.finish();
            }
        });
    }

}
</code></pre>

<blockquote>
  <p>Activity 2:secondScreen.java</p>
</blockquote>

<p>This contain simple button named as "Second screen"</p>

<pre><code>package com.hb.Screens;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

public class secondScreen extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);
        Button tv = (Button) findViewById(R.id.btn);
        tv.setText("Second screen");
    }

    @Override
    public void onBackPressed() {
        moveTaskToBack(true);
    }

    @Override
    protected void onResume() {
        super.onResume();

    }
}
</code></pre>

<p>This is my manifest file</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.hb.Screens"
      android:versionCode="1"
      android:versionName="1.0"&gt;
    &lt;uses-sdk android:minSdkVersion="4" /&gt;

    &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
        &lt;activity android:name=".HelloWorldActivity"

                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name=".secondScreen"&gt;&lt;/activity&gt;
     &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
