Sub Globals
Dim BarraDeEstadomView As Label
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
BarraDeEstadomView.Initialize("")
BarraDeEstadomView.Text =""
QuitarBarraEstatus
End If
Sub Activity_Pause (UserClosed As Boolean)
' para que vuelva a aparecer al salir (por ejemplo)
' la puedes llamar desde donde quieras
If UserClosed Then PonerBarraEstatus
Sub QuitarBarraEstatus
Dim mlp As JavaObject
Dim vtype As Int = -1, pixelFormat As Int = -3
Try
mlp.InitializeNewInstance("android.view.WindowManager$LayoutParams", Array(vtype, 100, 2010,296, pixelFormat))
Catch
End Try
Try
mlp.SetField("gravity", Bit.Or(Gravity.TOP, Gravity.CENTER))
Catch
End Try
Try
Dim windowManager As JavaObject = BarraEstatusGetContext.RunMethod("getSystemService", Array("window"))
Catch
End Try
Try
windowManager.RunMethod("addView", Array(BarraDeEstadomView, mlp))
Catch
End Try
End Sub
Sub PonerBarraEstatus
If BarraDeEstadomView.IsInitialized = False Then
' Quizas esto no sea necesario, pero puedes llamar a quitar y no reiniciar
BarraDeEstadomView.Initialize("")
BarraDeEstadomView.Text =""
End If
Try
Dim windowManager As JavaObject = BarraEstatusGetContext.RunMethod("getSystemService", Array("window"))
windowManager.RunMethod("removeView", Array(BarraDeEstadomView))
Catch
End Try
End Sub
Sub BarraEstatusGetContext As JavaObject
Return BarraEstatusGetBA.GetField("context")
End Sub
Sub BarraEstatusGetBA As JavaObject
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)
Return jo.GetFieldJO("processBA")
End Sub