0
I have an application with two activities.
A and B

Manifest xml showing the different activities .

    <activity
        android:name=".A"
        android:launchMode="singleInstance"
        android:excludeFromRecents="true"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".B"
        android:label="@string/title_activity_money_manager_home"
        android:screenOrientation="portrait">
    </activity>

The launch method of the activities is as below :
Activity A --> Activity B [launched from B]

Intent i = new Intent(this,B.class);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(i);

After that ,

I want 

i) **A** need not be seen in Recents 
ii) From **B** , If i press back key , **A** need not be shown . i.e A should be shown only once like a splash screen of an application
iii)The Activity **B** need to be in **new stack** and it need to be root of application


Please help me out ..
Rancho
  • 1
  • 2

1 Answers1

0

just call finish after startActivity

Intent i = new Intent(this,B.class);
startActivity(i);
finish();
aiwiguna
  • 2,852
  • 2
  • 15
  • 26