Android Question Transparent status bar on android 11

epneeh

Member
Hi,

i was able to do transparent status bar on android 10 and below with this code

B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim p As Phone
   If p.SdkVersion >= 4.4 Then
       Dim jo As JavaObject
       Dim window As JavaObject = jo.InitializeContext.RunMethod("getWindow", Null)
       window.RunMethod("addFlags", Array(Bit.Or(0x00000200, 0x08000000)))
       Activity.Height = Activity.Height + 80dip   
       Dim pnl As Panel
       pnl.Initialize("")
       pnl.Color = Colors.Red
       Activity.AddView(pnl, 0, Activity.Height + 24dip, 100%x, 80dip)
   End If
   Activity.LoadLayout("1")
End Sub

but after i update my phone to android 11, it wont work, any help appreciated, thanks.
 
  • Like
Reactions: omo

MikeSW17

Active Member
Licensed User
Longtime User
It may not be relvant, but SdkVersion is defined as in Integer. You're comparing it with a floating value?
Are you confusing Android versions and SDK versions?
 
Upvote 0

epneeh

Member
It may not be relvant, but SdkVersion is defined as in Integer. You're comparing it with a floating value?
Are you confusing Android versions and SDK versions?

yes it was a mistake, i found it somewhere in this forum, but basically my code are the same, sdk version for 4.4 is 19 if im not mistaken..


yes it work with b4xpages but my app are not using b4xpages, or should i change to using b4xpages?
 
Last edited:
Upvote 0
Top