Android paused app preview image black - android

In the list of the paused apps, Android usually shows a small preview image of the app.
However, the preview image is black when I use the following way to hide the navigation bar:
uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(uiOptions);
If I remove the last two options, the preview is shown correctly. Keep one and the preview is black.
Is this a bug or are there any reasons for this? Are there any workarounds?
Edit: I would like too add that I also see this behaviour on other games that hide the navigation bar, like Plants vs. Zoombies 2....but that could be on purpose.

Related

How to make a lock screen which prevents home, back, or overView press?

My intention is to make a Lock screen Application.
I already tried all available answers. If someone who did implement this kind of app, can help me then all the better.
In other lock screen Application home,back,overView press working but they not showing it. they are only persistently showing there there lock screen.
they are asking permission for Draw over other app for it.
You can hide navigation bar like this:
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(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
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

How, Android Bottom Navigation Bar hide permanently or disable

my requirement(security purpose) is when user log into my app he is not allow to
close app
navigate to another app
not allow to change setting
so to fulfilled this requirement i want to
Hide Bottom navigation Bar (or)
disable Bottom navigation bar
i try to hide bottom navigation bar using this code
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION ;
decorView.setSystemUiVisibility(uiOptions);
but when i touch screen again Bottom navigation reappear
This is banking app banking people requesting to do that if there any possibility
do this task or if you have any other solution please give me
It can not be permanently hidden- it would be android security issue
Try this:
View decor_View = getWindow().getDecorView();
int ui_Options = 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
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decor_View.setSystemUiVisibility(ui_Options);
But it need device android OS version is 4.4 or higher.

Strange behavior of fullscreen mode on Android 7.0

I have an application which will show fullscreen without problem on Android 4-6. But once test on Android 7.0, although the navigation and status bar are hide, the navigation bar position seems still occupied by a white bar. My application cannot automatically resize to occupy that space.
mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
I use the above code to do the fullscreen. Please advise. Thanks.

Permanently hide bottom bar

I am working on custom screen lock app where we need to full screen view hiding the top and bottom bars completely. The app is for Android phones only and not tablets. I achieved this partially by using Immersive mode but the issue is the bottom bar & top appears for few seconds on touching bottom or top of the screen.
Below is the code in my activity to do this :
final int flags = 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
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
getWindow().getDecorView().setSystemUiVisibility(flags);
I have tried various options but unable to hide the bars permanently. Please advise.

When Using Immersive Mode a line appears

I'm trying to use the immersive mode introduced in Android 4.4. I use this code to set the visibility and it works exactly how I want it to:
View decorView = getWindow().getDecorView();
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_STICKY;
decorView.setSystemUiVisibility(uiOptions);
However, it puts a line on the display. I have a screenshot but cannot post it because this is my first question. I have no idea what it is or how to get rid of it. Can anyone help?

Categories

Resources