Salve a tutti, premetto che sto cominciando adesso con b4a.Vorrei visualizzare il livello batteria su una edittext con la libreria OSllbrary ma mi da errore (null pointer exeption)non in compilazione ma sul device.
ecco il codice:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim batteria As OperatingSystem
batteria.Initialize("batteria")
Dim EditText1 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("prova")
EditText1.Text = batteria.BatteryLevel
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Avete qualche idea?
Vi ringrazio anticipatamente
ecco il codice:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim batteria As OperatingSystem
batteria.Initialize("batteria")
Dim EditText1 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("prova")
EditText1.Text = batteria.BatteryLevel
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Avete qualche idea?
Vi ringrazio anticipatamente