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.
Related
Using FLAG_SECURE, when app goes to background screen info are invisible, however, with this option users cannot take a screenshot anymore.
it's there any way to remove FLAG_SECURE when app back to FOREGROUND ?
Or any other solution for this problem ?!
You can put a black or white background in onPause and hide it in onResume if you dont need the FLAG_SECURE always active. This could prevent the window manager to exposes the screenshot in the window manager screen.
I'm setting my screen to be always awake in order to preventing it from going into sleep mode at all.
hence, when the screen display is turned off, the user has to touch the screen in order to bring it on again, but the problem is that this touch is received by the foreground activity and it reacts according to it, and the user is for sure just trying to turn the screen display on.
I tried to set the following flags but didn't work:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
&&
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
To resolve your issue you have to do one of the below things which prevents screen to turn off automatically.
Add android:keepScreenOn="true" to some widget in your layout XML resource for this activity. So long as that widget is visible on the screen, the screen will not turn off automatically.
OR
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
to disable the screen timeout and
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
to re-enable it.
I'm customizing my app to provide a better experience with the Kindle Fire.
in this device, if you do in your Activity
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
the soft bar with the back, home and setting buttons disappear, and only appear when the user presses the "fullscreen handle" the soft button bar is back on screen.
https://developer.amazon.com/sdk/fire/screen-layout.html#StatusSoft
I want to detect devices that have this behaviour, this is, devices that have not a physical back button or a permanent back soft button, so I could set up the window differently in these cases.
I'd like to do it programmatically, and avoid having to declare a config property (and thus maintaining more than one apk).
Thanks.
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
There should be a bunch of buttons on dark gray background right of the phone screen. I started playing with the keyboard shortcuts available in that window and I must have done something to make the whole right-hand side of the emulator window disappear. How do I restore it?
This may be of help: http://www.android.encke.net/android-emulator-tutorial.html - Ctrl-F11/F12 may get you back in order.