1

enter image description here

i am using one app, for example chrome with some confidential information and i am switching it to background & i am trying to kill the app.

i uploaded the example image when trying to kill the app. even the session the expired it won't close the information in the killing stage when app comes foreground then only it closes the information. i want the info should be closed or hided when it goes background (In killing stage).

i searched in google i am not getting anything related to this and i don't know whether my search phrase is correct. can anyone pleas help me.

user3546693
  • 364
  • 3
  • 18

1 Answers1

5

I think ur asking this:

Just add this in manifest file:

android:excludeFromRecents="true"

Example:

  <activity
            android:name=".MainActivity"
            android:excludeFromRecents="true"
            android:taskAffinity=".OnInviteActivity"
            android:noHistory="true"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

then your app will not show in background or recent app or in menu like that

UPDATE:

for ur app name only u need to add this in Main Activity:

 getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
User Learning
  • 3,165
  • 5
  • 30
  • 51