Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private OW As OverlayWindow
Public Su As SuShell
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
OW.Initialize(0,0,50dip,50dip,"ow")
If Su.DeviceRooted Then
If Su.ExecuteWithEvent("ls", "Su").WaitForCompletion Then
Su.Execute("appops set b4a.example SYSTEM_ALERT_WINDOW allow").WaitForCompletion
Log("rooted")
Else
Log("not rooted")
End If
Else
Log("not rooted")
End If
OW.Panel.Color=Colors.Red
OW.Open
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
Private br As Intent
br.Initialize(br.ACTION_VIEW, "https://google.com")
StartActivity(br)
End Sub