hie, i have seen the previous tutorial which Erel had posted about rejecting/disconnecting the call.
https://www.b4x.com/android/forum/threads/end-call-incoming.19714/
i tried using the same code but getting some error. can anyone pls help?
Basically i have to detect an incoming call which is running as a service(whole thing has to run as a service) and get the number. Till here it works fine. That incoming call has to be disconnected after 2 rings. how do you achieve that?
This is the log i get after trying that reject call method
line 62 is the last line of the killCall sub of the above shared link.
"r.RunMethod("endCall")"
thanks in advance.
https://www.b4x.com/android/forum/threads/end-call-incoming.19714/
i tried using the same code but getting some error. can anyone pls help?
Basically i have to detect an incoming call which is running as a service(whole thing has to run as a service) and get the number. Till here it works fine. That incoming call has to be disconnected after 2 rings. how do you achieve that?
This is the log i get after trying that reject call method
B4X:
LogCat connected to: 2a213eb
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Service (phdetect) Create **
** Service (phdetect) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (phdetect) Create **
** Service (phdetect) Start **
Error occurred on line: 62 (Main)
java.lang.SecurityException: Neither user 10141 nor current process has android.permission.CALL_PHONE.
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1499)
at com.android.internal.telephony.ITelephony$Stub$Proxy.endCall(ITelephony.java:1384)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:216)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at com.nma.incomingph.main._toastphn(main.java:494)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (phdetect) Create **
** Service (phdetect) Start **
line 62 is the last line of the killCall sub of the above shared link.
"r.RunMethod("endCall")"
thanks in advance.