i tried reflection library but code throws nullpointerexception erro
B4X:
Dim r As Reflector
r.Target = r.GetContext
Dim TelephonyManager As Object
TelephonyManager = r.RunMethod2("getSystemService", "telephony", "java.lang.String")
r.Target = TelephonyManager
Log(r.runPublicMethod("getCallState",null,null))
As i told i have used broadcast receiver but there exist some issue.
& i cannot find samples/tutorial of reflection library so i cannot do more.
i updated code but still it throws error
B4X:
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "telephony", "java.lang.String")
Log(r.RunMethod("getCallState"))