Android Question The application is blocked for an error abnormally.

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Hi,
My Widget, when I release into screen, cause a abnormal error:confused:
What is the problem?


B4X:
** Service (srvpickup) Create **


** Service (srvpickup) Start **


Bitmap:0


CLICKED
** Activity (menu) Create, isFirst = true **


-------:2


** Activity (menu) Resume **


** Service (srvpickup) Start **
Bitmap:0


** Service (srvpickup) Start **


java.lang.NoSuchMethodException: cancel []


    at java.lang.Class.getConstructorOrMethod(Class.java:460)
    at java.lang.Class.getDeclaredMethod(Class.java:685)
    at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
    at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
    at com.widgetPickUp.toast._cancel(toast.java:33)
    at com.widgetPickUp.srvpickup._service_start(srvpickup.java:542)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at com.widgetPickUp.srvpickup.handleStart(srvpickup.java:68)
    at com.widgetPickUp.srvpickup.onStartCommand(srvpickup.java:53)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2493)
    at android.app.ActivityThread.access$1900(ActivityThread.java:133)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1295)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4777)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to start service com.widgetPickUp.srvpickup@42120630 with Intent { cmp=com.widgetPickUp/.srvpickup (has extras) }: java.lang.RuntimeException: java.lang.NoSuchMethodException: cancel []


    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2510)
    at android.app.ActivityThread.access$1900(ActivityThread.java:133)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1295)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4777)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: cancel []
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:201)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at com.widgetPickUp.srvpickup.handleStart(srvpickup.java:68)
    at com.widgetPickUp.srvpickup.onStartCommand(srvpickup.java:53)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2493)
    ... 10 more
Caused by: java.lang.NoSuchMethodException: cancel []
    at java.lang.Class.getConstructorOrMethod(Class.java:460)
    at java.lang.Class.getDeclaredMethod(Class.java:685)
    at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
    at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
    at com.widgetPickUp.toast._cancel(toast.java:33)
    at com.widgetPickUp.srvpickup._service_start(srvpickup.java:542)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    ... 14 more
 

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Thanks Luca and Erel.
I've added into Sub a control and it now working.


B4X:
Sub Cancel
'Added control for null or unknow value. Capture only "android.widget" 
Dim strT As String
strT=T
If strT.SubString2(0,14)="android.widget" Then
    R.Target=T
    R.RunMethod("cancel")
End If
End Sub
 
Upvote 0
Top