Detect "Recent" Button is Pressed?

Detect "Recent" Button is Pressed?
0.0 0


Hi, I just wondering how to detect if Recent Apps button is being pressed?

I know that we can detect keyBackClicked and keyMenuClicked through cocos2d-x
Is there away to detect if the Recent Apps button is being pressed?
This button is available on devices like Galaxy Samsung Tab.





im using cocos2d-2.0-x-2.0.4
tried to use this, to check if app is on top

public String isAppOnTop()
ActivityManager am = (ActivityManager) getSystemService(Service.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> tasks;
tasks = am.getRunningTasks(1);
RunningTaskInfo running = tasks.get(0);
System.out.println("here "+running.topActivity.getPackageName());
return “true”;
return “false”;

but it doesnt work. for some reason the overlay menu for Recent App or the option/clock overlay menu, both of them are not considered as other app??

Is there a way to detect if Recent App button is pressed? or if there’s an overlay menu (for recent app list or option/clock menu) appears on top of the main app?

do I need to use cocos2d-x 3.0?

hope somebody can help me.