Hello,
I have added the following code to capture back key and write my own logic.
But whenever I press back button the app crashes with following error log. But if I remove the activity_keypress code module then it works properly. I am not able to debug this problem, can someone help me with this? thanks
I have added the following code to capture back key and write my own logic.
B4X:
Sub Activity_KeyPress (KeyCode As Int)
If KeyCode = KeyCodes.KEYCODE_BACK Then
HomePage.MediaPlayer1.Play
End If
End Sub
B4X:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at b4a.weddingapp.viewvideo$HandleKeyDelayed.runDirectly(viewvideo.java:228)
at b4a.weddingapp.viewvideo.onKeyDown(viewvideo.java:215)
at android.view.KeyEvent.dispatch(KeyEvent.java:2609)
at android.app.Activity.dispatchKeyEvent(Activity.java:2361)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1819)
at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3575)
at android.view.ViewRootImpl.handleImeFinishedEvent(ViewRootImpl.java:3545)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2795)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)