Hide softkeys on my android app - android

In my app I want to remove completly the softkeys (back, home, etc).
I've managed to do that with:
getWindow ( ).getDecorView ( ).setSystemUiVisibility ( View.SYSTEM_UI_FLAG_HIDE_NAVIGATION );
But when I touch the screen it comes back, and does not go away...
I also have "android:theme="#android:style/Theme.NoTitleBar.Fullscreen" on manifest and
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Does not help...
Anyone knows how to get over this?
Thanks.

Related

Android fullscreen activity without battery icon

I am developing an android application which contains a full screen activity but i am unable to hide default android battery , time etc. icons from the screen
For example :-
I think this is something like android immersive full screen view
So can any one tell me how can i achieve this
you can do it in java file by
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
or in AndroidManifest.xml
<activity android:name=".ActivityName"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>
With transparent notification bar read this link.
There is a new feature called Immersive FullScreen mode where all the UI elements other than your Activity are hidden. One can get those those back by swiping down.
Use the following code to achieve this :
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

Disable touchs and UI in VideoView in fullscreen kiosk mode?

I need to run VideoView in splash kiosk mode.
So I set it to fullscreen (all UI hidden, LOW_PROFILE etc). Mediacontroller not set and not exists. videoview set to not clickable in xml. VideoView OnTouch method overrided. Zorder set to -1. I tried all methods...
but!
Any touch of running VideoView shows me bottom navigation bar (back, home etc) on tablet.
System hides it automatically at 3 seconds. I can not override it :(
How to make VideoView in fullscreen - fully untouchable?
I found a solution, never seen it here.
this totally disables bottom UI on tablet (but leave upper bar on phone)
videoView.setSystemUiVisibility(View.GONE);
to hide status on phone just set in activity onCreate as usual:
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_fullscreen);
Have been fighting with this for a while, and it turns out nothing happens if you set the flags on the VideoView, but works when you do it on the mediaController:
mediaController.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN);
A remaining problem is that the video now doesn't seem to respond to touch at all, so the media controls are also gone.

statusbar reappears after screen off

my android app is displayed fullscreen.
to be 100% sure I did this in code with:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.findperson);
and in xml with
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
whenever my screen turns off for power saving, and i turn it back on again, the statusbar is back and does not want to disappear. How can i make it disappear forever (or for the duration of my app)?
edit:
okay, i did find some more info this:
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
interferes with the fullscreen setting.
I know we are not "supposed to" override the homebutton. However, I am desiging an app that is exclusively used on the phone. in other words, the phone should lose its phone function and only show this app.

Android Bring Back to Original State

This might be a noob question.
Actually I am trying to toggle the Activity Windows using a click.
With one click , my Activity goes FullScreen and the Next time I click , It should come back to Non-FullScreen State.
I made if Full Screen using:
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
but now I cannot return back to the NonFullScreen State.
How can I do it?
Thanks in Advance :)
To enable full screen:
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
To go back to non-fullscreen:
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

Android Navigation bar appearing when in full screen

In my application, I have set it up in the XML so it is in full screen using
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
Now this works fine when the app opens, however if while using the app, I use the home button to back out of the app, and then open it again, when it opens, a black navigation bar will appear for a second or two before disappearing. This does not occur if I exit the app using the back button, just the home button.
Does anyone know why this happens? I have tried doing it from code instead using
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
However, what this does is removes the title bar, but the black bar is there at the top, just nothing is in it.
I.e. this bar
I tried combining the code, by putting the full screen line of code in the XML and also adding the code I showed above into the app, but same thing happens. If I back out of the app with home button and enter it again, that black bar will appear for two seconds temporarily pushing the app and its contents down before righting itself again.
How do I go about fixing this? I have been trying loads of different solutions, but nothing seems to work.
Thanks in advance
Seems to a bug with Android OS. Only way to fix it is go to device, settings animation, and disable animations.
try to remove animation by setting->brightness->animation
set no animation there

Categories

Resources