Android Question Exclude from recents programatically

plager

Member
Hello community,
I am about to make my app being exlude from recents list programatically. Unfortunatelly, can't achieve that in any way.
I obviously do know about tag in manifest:
B4X:
SetActivityAttribute(Main, "android:excludeFromRecents", "true")
However, it doesn't work in runtime mode, in different words - manifest can't be changed in runtime.

I went through forum, found some threads, but none of those works for me:
B4X:
https://www.b4x.com/android/forum/threads/remove-app-from-recent-list-or-reset-intent.32316/
https://www.b4x.com/android/forum/threads/activity-getstartingintent-setactivityresult.19865/
https://www.b4x.com/android/forum/threads/using-startactivityforresult-with-javaobject.40374/

In mine project there is (only) one activity called 'Main'.
So, how can I achieve to change this main acitivity be excluded from recent (or not) according to user choice?
 
Top