How to Disable the Recent Tasks/Apps Button

Disable recent tasks button on Android 5.0

Finally I was able to achieve this by following:

@Override
protected void onPause() {
super.onPause();

ActivityManager activityManager = (ActivityManager) getApplicationContext()
.getSystemService(Context.ACTIVITY_SERVICE);

activityManager.moveTaskToFront(getTaskId(), 0);

}

will need permission ...

<uses-permission android:name="android.permission.REORDER_TASKS" />

Android - How to turn off home/back/recent apps buttons light on Google Pixel 2

I solved myself. It works well.

private void disableHomebutton() {
final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE;

mainView.setSystemUiVisibility(uiOptions);

mainView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
mainView.setSystemUiVisibility(uiOptions);
}
});

mHomeKeyLocker.lock(this);
}

Hide screen in 'Recent Apps List', but allow screenshots

I think what you need is:

android:excludeFromRecents="true"

put that in your android manifest inside your <activity>(activity you want to exclude from recents)</activity>



Related Topics



Leave a reply



Submit