Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Remove app from recent....

Discussion in 'Android' started by KumarBurela, May 13, 2015.

  1. KumarBurela

    KumarBurela

    Joined:
    May 29, 2011
    Posts:
    23
    Hi all,

    I am having a problem like 'Remove app from recent' in android devices. And i used Android Manifest (.xml)
    also but i unable get the perfect solution for it. What can i do plz help me.

    Thnax in advance......
     
  2. Dinochrome

    Dinochrome

    Joined:
    Apr 23, 2018
    Posts:
    19
    Quite a delayed answer, but maybe somebody will find this useful -
    To remove app from recent you just have to add

    android:autoRemoveFromRecents="true"

    to AndroidManifest.xml in <activity> tag.
    Then Application.Quit(); will quit the app and it will be removed from recent list.

    In my case it look like this:
    Code (JavaScript):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.app.app" android:versionCode="1" android:versionName="1.0">
    3.   <application android:label="@string/app_name" android:icon="@drawable/app_icon">
    4.     <activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:autoRemoveFromRecents="true">
    5.       <intent-filter>
    6.         <action android:name="android.intent.action.MAIN" />
    7.         <category android:name="android.intent.category.LAUNCHER" />
    8.       </intent-filter>
    9.       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    10.     </activity>
    11.     <service android:name="com.google.firebase.messaging.MessageForwardingService" android:exported="false" />
    12.   </application>
    13. </manifest>