I'm getting an error when I'm checking the battery level
This is the sub:
I'm targeting API29
B4X:
java.lang.IllegalArgumentException: method com.coredata.exp.main._pe_batterychanged argument 2 has type int, got null
This is the sub:
B4X:
Sub PE_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
If Level = 15 Then
Msgbox2Async("The Battery level is down to 15% Consider recharging or replacing the battery!","Core","OK","","",LoadBitmap(File.DirAssets,"Exclamation-icon.png"), False)
End If
If Level = 5 Then
Msgbox2Async("The Battery level is down to " & Level & "% You Risk Losing Data. RECHARGE THE BATTERY NOW!","Core","OK","","",LoadBitmap(File.DirAssets,"Exclamation-icon.png"), False)
End If
'Log("The battery level is: " & Level)
End Sub
I'm targeting API29