Suppose there are only 2 Activities in an Application :
1. Activity A (Launcher Activity)
2. Activity B
Code for Acrivity A in onCreate() :
Intent intent = new Intent();
intent.putExtra("key", "test");
intent.setClass(this, ActivityB.class);
startActivity(intent);
finish();
So, launching Activity B from Activity A, by passing a data. Also Activity A get destroyed.
So, if I launch the app for first time :
1. Activity A started
2. Activity A launches Activity B with a data
3. Activity A get destroyed
Suppose If I press the back key from Activity B, Activity B get destroyed and the application get exit and if I re-launch the app :
1. Activity B get started directly, getting the same data, that was set from Activity A.
My Question is :
How Can I stop getting this intent when app get re-launched ?
Activity B started after re-launch, is not an issue, I just wanted to stop getting the intent.
AndriodManifest.xml :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.listnertest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="ActivityA"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="ActivityB"
android:label="@string/app_name" >
</activity>
</application>