Android Question Toggling Fullscreen

edgeryder1000

Member
Licensed User
Longtime User
Status bar won't come back!
After reading a ton of threads I still haven't found any code that will display the status (notification) bar after I hide it. Here is the code I was using:
B4X:
Sub FullScreen(Active As Boolean, ActivityName As String)
    Dim obj1 As Reflector
    obj1.Target = obj1.GetMostCurrent(ActivityName)
    obj1.Target = obj1.RunMethod("getWindow")
    If Active Then
        obj1.RunMethod2("addFlags",1024,"java.lang.int")
        obj1.RunMethod2("clearFlags",2048,"java.lang.int")
    Else        
        obj1.RunMethod2("addFlags",2048,"java.lang.int")                                 obj1.RunMethod2("clearFlags",1024,"java.lang.int")
    End If
End Sub
Where 1024 and 2048 are the constant values of flag_fullscreen and flag_force_not_fullscreen

It appears to me that this should work, but when I call FullScreen(False,"Main") nothing happens.
Help?
 

edgeryder1000

Member
Licensed User
Longtime User
The only time I can get it to do anything is in Activity_Create (after setting the project to fullscreen in IDE options).
Could you upload an example so I can rule out it being my version of B4A or java or rom, etc. etc.
OR could you test if the attached project works for you?

Thanks in advance
 

Attachments

  • test.zip
    9.7 KB · Views: 240
Last edited:
Upvote 0
Top