The full screen mode exists since API 14, but it was the Lean Back mode (you had to touch the screen, not swipe). For me, it was a bit difficult to use it without issues and it was not for apps where the user interacts with the screen.this = Full screenmode
And it work also with 4.2.2
But only gray are at the bottom. But Buttons are away
What is the conclusion?Yes Sorry you are right! If i touch the schreen the fun is over
Now i must update my screen (HP Slate21) to Android 4.4
java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
Hi RandomCoder, the error actually comes up as soon as i slide down from the top to make the soft menu appear, and yes i'm too using the fixed landscape mode.At what point does it throw the error? I've started to use immersive mode without issues but I'm running my app in fixed landscape mode and so I don't need to set the listener which is the part I'm guessing is causing you the error?
i've tried the code Informatix provided here but it doesn't work properly
Hi RandomCoder, thanks so much for the code, i haven't had time to try it out yet, I will as soon as i get some free time, again, thank you!Hi @walterf25 please find attached a sample project demonstrating how I set and use ImmersiveMode. It's pieced together from posts I've found here on the forum, I'm not sure if the way I save the calling Activity is correct? Basically I wanted to store the code to set ImmersiveMode in a separate Code Module then as I choose to add new Activities I can just call the function and if I ever make changes there's only one place I need to make those changes. I like to try and keep things neat and reduce duplicate code as much as possible
The reason for loading my layout and setting ImmersiveMode in Activity_Resume instead of Activity_Create is because when using the back button to move to an Activity that has already been loaded, the Activity_Create sub is not triggered and so you end up with the NavigationBar showing again. Using Activity_Resume prevents this from happening.
You also don't need to use all the constant declarations in my "Set_ImmersiveMode" subroutine. I've only done this for clarity in case I need to add more flags in the future. These values can all be combined into one value as normally used elsewhere here on the forum.
Since creating this sample I've noticed that the NavigationBar does momentarily shows when first loading the Activity. I've not noticed this in my own App because I typically only use one Activity with tabbed views on it after the initial Splash and login screen. Therefore I don't see this effect as I'm not changing Activities. Hopefully it's minor enough not to cause you a problem.
If you need further help I can try but this is about the extent of my knowledge on the subject
main_forceimmersivemode (java line: 4488)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
at anywheresoftware.b4a.agraham.reflection.Reflection.GetActivity(Reflection.java:661)
at com.omnicorp.lcarui.test.main._forceimmersivemode(main.java:4488)
at com.omnicorp.lcarui.test.main._activity_windowfocuschanged(main.java:1630)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at com.omnicorp.lcarui.test.main.onWindowFocusChanged(main.java:183)
at com.android.internal.policy.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:3237)
at android.view.View.dispatchWindowFocusChanged(View.java:9534)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1200)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3378)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
mainonWindowFocusChanged (java line: 183)
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:206)
at com.omnicorp.lcarui.test.main.onWindowFocusChanged(main.java:183)
at com.android.internal.policy.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:3237)
at android.view.View.dispatchWindowFocusChanged(View.java:9534)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1200)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3378)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
at anywheresoftware.b4a.agraham.reflection.Reflection.GetActivity(Reflection.java:661)
at com.omnicorp.lcarui.test.main._forceimmersivemode(main.java:4488)
at com.omnicorp.lcarui.test.main._activity_windowfocuschanged(main.java:1630)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
... 11 more
--------- beginning of crash
** Activity (main) Resume **
main_forceimmersivemode (java line: 4480)
java.lang.NullPointerException: Attempt to read from field 'com.omnicorp.lcarui.test.api com.omnicorp.lcarui.test.main._api' on a null object reference
at com.omnicorp.lcarui.test.main._forceimmersivemode(main.java:4480)
at com.omnicorp.lcarui.test.main._activity_windowfocuschanged(main.java:1626)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at com.omnicorp.lcarui.test.main.onWindowFocusChanged(main.java:183)
at com.android.internal.policy.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:3237)
at android.view.View.dispatchWindowFocusChanged(View.java:9534)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1200)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3378)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
java.lang.NullPointerException: Attempt to read from field 'com.omnicorp.lcarui.test.api com.omnicorp.lcarui.test.main._api' on a null object reference