Android Question Error when executing Back key on empty Edittext

RoseAsano

New Member
Sorry for my English. I write from Brazil.

I'm having a problem I can't solve. When I press the Back key on an empty EditText,
the error below occurs. I tracked it, and the last event executed before the error is the routine below.
The returned KeyCode is 67, so Activity.Finish is not executed.

Sub Activity_KeyPress (KeyCode As Int)

If KeyCode = KeyCodes.KEYCODE_BACK Then
Activity.Finish
end If
End Sub


Log:

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at pontov.spi.parametros$HandleKeyDelayed.runDirectly(parametros.java:230)
at pontov.spi.parametros.onKeyDown(parametros.java:217)
at android.view.KeyEvent.dispatch(KeyEvent.java:2854)
at android.app.Activity.dispatchKeyEvent(Activity.java:4263)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:423)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6529)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6395)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5877)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5934)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5900)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6065)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5908)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6122)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5881)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5934)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5900)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5908)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5881)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8895)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8811)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8780)
at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:5620)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:5492)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:238)
at android.os.Looper.loop(Looper.java:357)
at android.app.ActivityThread.main(ActivityThread.java:8090)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
 
Top