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
How to Launch the 'Add Contact' Activity in Android
Android Can't Record Video with Front Facing Camera, Mediarecorder Start Failed: -19
How to Create Multiple Pendingintents with the Same Requestcode and Different Extras
Failed to Import New Gradle Project in Android Studio
How to Get the Current Dns Servers for Android
Asynctask, Must It Take Such a Performance Penalty Hit...
How Do Cursorloader Automatically Updates the View Even If the App Is Inactive
Scoping States in Jetpack Compose
Android 4.4 Giving Err_Cache_Miss Error in Onreceivederror for Webview Back
Using an Android Library Project Activity Within Another Project
Mediametadataretriever.Getframeattime() Returns Only First Frame
Having Issue on Real Device Using Vector Image in Android. Svg-Android
Firebase: How to Set Default Notification Channel in Android App
Viewing Excel Files in My Android App
Yuv to Rgb Conversion by Fragment Shader