0

This works perfectly on Lollipop:

recents_button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // Perform action on click
            Intent intent = new Intent ("com.android.systemui.recents.SHOW_RECENTS");
            intent.setComponent (new ComponentName ("com.android.systemui", "com.android.systemui.recents.RecentsActivity"));
            startActivity (intent);
        }

But on Marshmallow I get:

java.lang.SecurityException: Permission Denial: starting Intent { act=com.android.systemui.recents.SHOW_RECENTS cmp=com.android.systemui/.recents.RecentsActivity } from ProcessRecord{96f7c1e 4931:com.myapp/u0a188} (pid=4931, uid=10188) not exported from uid 10043
zamarov
  • 165
  • 2
  • 16

1 Answers1

2

You can see that intent is not exported by Marshmallow, while it was exported by KitKat.

Tasker is able to show the recent apps dialog, I don't know how it does it.

memeplex
  • 2,297
  • 27
  • 26