Method to detect 'Recents' or 'Back' softkey press

Post your questions and help other users.

Moderator: Martin

Post Reply
ar234948
Posts: 6
Joined: 01 Jun 2016 21:15

Method to detect 'Recents' or 'Back' softkey press

Post by ar234948 » 24 Jun 2016 13:15

I tried searching the forum and scratching my brain a bit, but couldn't figure out a method to detecting a press of the Recents or Back softkey.

Is there a way to detect the press of each key?

Thank you.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Method to detect 'Recents' or 'Back' softkey press

Post by Martin » 24 Jun 2016 19:32

Hi,

Detecting the back and recents keys directly is not possible at the moment. You could try to detect the effects of the keys. Back key will be difficult but recents key could be detected with trigger Activity Started, package:- com.android.systemui, class name: com.android.systemui.recents.RecentsActivity (on a stock Android from Google).

Regards,
Martin

Post Reply