Android 屏蔽recent task 按钮

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)
原文地址:https://www.cnblogs.com/nimorl/p/6416457.html