Android Question How to show system bar in full size screen

Richard Goh

Active Member
Licensed User
Longtime User
As attached picture. Is it an immersive mode?
 

Attachments

  • title bar.JPG
    title bar.JPG
    18.6 KB · Views: 285
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Hi Erel,
It's does show and with default color.
How can I set the bar color to red? I did set using Activity.TitleColor = Colors.Red but not working.
Due to the requirements I need to set it to red color.
Thank you.
 
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Hi Erel, I got it by using below code. thanks.
B4X:
Sub SetStatusBarColor(clr As Int)
   Dim p As Phone
   If p.SdkVersion >= 21 Then
     Dim jo As JavaObject
     jo.InitializeContext
     Dim window As JavaObject = jo.RunMethodJO("getWindow", Null)
     window.RunMethod("addFlags", Array (0x80000000))
     window.RunMethod("clearFlags", Array (0x04000000))
     window.RunMethod("setStatusBarColor", Array(clr))
   End If
End Sub
 
Upvote 0
Top