Hello all,
Moving forward on my project I started a Service to handle in the background BLE.
It appears to start up OK, but when I go to check and request a permission (code below), the app crashes. I've tried having the rp variable in either the BLE Service or in the Starter (as a Public Var). Neither location makes a difference, it always crashes at the point shown below.
For Each Permission As String In Array("android.permission.ACCESS_FINE_LOCATION", "android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT")
Log("Permission = " & Permission )
#If B4A or B4i
rp.CheckAndRequest(Permission) <<========== Error
' Starter.rp.CheckAndRequest(Permission) <<==== Error (when not remarked)
#End If
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
This is the error message provided - there are several other lines, but not really sure how much anybody might need to provide some help...
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
Any ideas, direction or help would be greatly appreciated!
Thank you,
Tim