Step 1
Add this permission to the manifest.xml
file
<uses-permission android:name="android.permission.REORDER_TASKS" />
Step 2
Put this code in any Activity
on which you want to block/disable the recent apps button
@Override protected void onPause() {
super.onPause();
ActivityManager activityManager = (ActivityManager) getApplicationContext()
.getSystemService(Context.ACTIVITY_SERVICE); activityManager.moveTaskToFront(getTaskId(), 0);
}
经测试,在Android4.3中使用无误(2017.02.19)