Description of the problem
In one of my applications, I see a rather strange behavior: when my application runs in the foreground (the topmost), I can see its actions in the Recents system. But as soon as I put it in the background, the same action (i.e. AccountsActivity ), which was listed a few moments ago, is no longer present in Recents. Related part of my manifest file:
<application android:name=".WebnetApplication" android:allowBackup="false" android:allowClearUserData="true" android:hardwareAccelerated="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".StartActivity" android:alwaysRetainTaskState="true" android:excludeFromRecents="true" android:label="@string/app_name" android:theme="@android:style/Theme.NoDisplay" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".AccountsActivity" android:excludeFromRecents="false" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" /> ...
conclusions
Since this is the only application that changes incorrectly, I checked all the styles and my WebnetActivity and WebnetApplication so that I did not call anything that could affect Recents. Nothing like this.
Then I started to delimit the manifest file to see if something changes. And, as expected, the offender is hiding there, but for me this is not entirely clear. When launched, the AccountsActivity entry in the manifest did not have an android:excludeFromRecents entry at all - this led to the fact that the AccountsActivity was not visible at all in Recents. When I added android:excludeFromRecents="true" , then the activity will become visible in Recents, but only when it was in front. When I went to the back, he disappeared from the respondents. When I remove android:excludeFromRecents="true" from the StartActivity , then AccountsActivity becomes visible in Recents regardless of whether the application is in front or in the background, and I can completely remove android:excludeFromRecents from its record without any problems.
Question
At the moment, I am leaning towards my head, trying to understand why all this behaves like this - is it normal (and I donβt know something), or is this, perhaps, a mistake within the framework? Has anyone encountered a similar problem and can share experience, ideas or explanation?
android android-manifest android-recents
Marcin orlowski
source share