3

Dear fellow developers,

I am developing some kind of tool to launch applications. Currently, I am just getting the default launch component form the package manager (queryIntentActivities, ACTION_MAIN, CATEGORY_LAUNCHER) and launching it with that. I don't add any flags or anything. What I wanted to do is, instead of launching the app everytime from scratch, resume the application (no matter if it's in its default launcher activity or in any other activity) like the recent task switcher does.

In the AOSP source code of the Task switcher (called "Recent"?) I found following loc.

intent.setFlags((intent.getFlags()&~Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED)
                | Intent.FLAG_ACTIVITY_NEW_TASK);

See https://github.com/android/platform_frameworks_base/blob/master/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java

However, this flag setting did not fix anything for me. I tried several combinations of flags but didn't get the wanted result.

Any idea what I am doing wrong? I'll happily provide you with more information.

Aeefire
  • 888
  • 10
  • 25

0 Answers0