我正在开发的应用程序在导航时未显示在“最近的项目”中。我知道它不会关闭应用程序,因为我可以从应用程序图标启动它,并且保留了我离开它时的状态。 SO的主要建议是主要活动中的2个清单属性,解决这些问题似乎可以解决大多数人的问题:
<activity
android:label=""
android:excludeFromRecents="true" />
将空标签和/或excludeFromRecents属性设置为true是大多数这些问题的原因。不幸的是,对我而言并非如此。请在下面找到我的清单代码:
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" tools:overrideLibrary="com.experience.android.webviewintegrator,another.library.here"/>
<permission android:name="permission.name" android:protectionLevel="signature" />
<uses-permission android:name="permission.name" />
<!--Every app defines its permissions-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:name="com.application.name.here"
android:largeHeap="true"
android:icon="@drawable/app_icon"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
tools:replace="android:icon,android:theme,android:name,android:networkSecurityConfig">
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="@string/app_google_maps_api_key"/>
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<activity android:name="com.activity.name.here"
android:label="@string/app_name"
android:windowSoftInputMode="adjustPan"
android:configChanges="orientation|screenSize|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="schemeName" android:host="browser" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="schemeName" android:host="home" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="schemeName" android:host="web_panel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="schemeName" android:host="widgets_panel_flat_spec" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="schemeName" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="host" />
<data android:host="alsoAHost" />
<data android:pathPrefix="/" />
</intent-filter>
<intent-filter>
<action android:name="com.company.receiver" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="schemeName" android:host="applink" />
</intent-filter>
<intent-filter>
<action android:name="com.venuenext.stadium.RECEIVER" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="schemeName" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="schemeName"/>
<data android:host="@string/launch_host_tm_account" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="schemeName" />
</intent-filter>
<intent-filter>
<data android:scheme="schemeName" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
</application>
我尝试过的事情: