Possible duplicate : How not to show the application in the list of recent applications in ICS? excludeFromRecents not working
Let's say I have two activities A (main action) and B. I start B with A as follows:
Intent i = new Intent(A.this, B.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i);
I want my application to have only one regent entry at any time, and B for a new task. If B has a manifest entry as follows, I achieve this:
<activity android:name="com.example.verysimpleactivity2.app.B" android:excludeFromRecents="true" android:label="B" ></activity>
But I also want B to have a different task, and not the main activity, i.e. A. Therefore, I modify the manifest entry as follows:
<activity android:name="com.example.verysimpleactivity2.app.B" android:excludeFromRecents="true" android:taskAffinity="" android:label="B" ></activity>
In this case, if B is not in the foreground, then it does not appear in repetitions, and I only have A (good!). However, if B is in the foreground and I press the recents button, I see both A and B there. Why is B shown in these cases in this case? How to make sure I donβt see B at all?
source share