Bug? Extrange behaviour: An error arises when there is no breakpoint

Discussion in 'Bugs & wishlist' started by javiito, May 28, 2015.

  1. javiito

    javiito Member Licensed User

    Hi,
    In debug-rapid mode, the following code
    Code:
    Dim Image2 As ImageView
    Image2=Panel1.GetView(
    1)
    If Bit.AND(Modulo.dispositivos(Dispositivo).Valor, 128)=128 Then
        Image2.Visible=
    True
    Else
        Image2.Visible=
    False
    End If
    should enter the "Else" condition (Image2.Visible=False) but the code fails in the second line (Image2=Panel1.GetView(1)) if the code is executed without interruptions.

    If i put breakpoint e.g. at the fourth line (Image2.Visible=True) where the execution never enters, the code does not fail.

    In release mode it always fail.

    The error is:

    java.lang.ClassCastException: anywheresoftware.b4a.BALayout cannot be cast to android.widget.ImageView
    at domotica.server.main._actualizardispositivo(main.java:2361)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:305)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at anywheresoftware.b4a.BA$3.run(BA.java:332)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    at dalvik.system.NativeStart.main(Native Method)


    Thanks!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Seems like item #2 is a panel, not a label.
     
    Peter Simpson likes this.
  3. javiito

    javiito Member Licensed User

    Ooops, it is. The funny thing is that the code worked until I removed all breakpoints, so I didn't realise there could be a mistake.

    Thanks Erel!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice