Hello, i have a question, when a sub run (edittext textchanged) in a class i have an error and if i add an empty line (line feed) at the top of sub there is no more error?
if I modify the code of this sub or another above, I have an error again and I have to remove the second empty line at the beginning of the sub and there are no more errors ???
there is a listview on the panel but normally it should not "go up" because its tag is not the correct one.
sometimes the sender is a timer.
I specify that there are 2 timers in this class and that one of them is at 0.1s
apart from this "problem", my class is functioning very well.
I modify it to add functions ...
Thank you and good day,
laurent.
ps:excuse my english, thank you google translate
if I modify the code of this sub or another above, I have an error again and I have to remove the second empty line at the beginning of the sub and there are no more errors ???
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 3123 (element)
java.lang.ClassCastException: anywheresoftware.b4a.objects.ListViewWrapper$SimpleListView cannot be cast to android.widget.TextView
at b4a.example.element._exp_to_focuschanged(element.java:5570)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$1.run(BA.java:352)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
B4X:
Sub exp_to_FocusChanged (HasFocus As Boolean)
If (Sender=Null) Or (GetType(Sender)<>"android.widget.EditText") Then Return
Dim tx As View=Sender
If (tx Is EditText) And (tx.Tag="exp_to") Then
If HasFocus Then
foc=2
Dim pan As Panel=tx.Parent
For Each rx As Label In pan
If rx.Tag="lbl_plus2" Then
rx.TextColor=Colors.Red
Else
If rx.Tag="lbl_plus1" Or rx.Tag="lbl_plus3" Or rx.Tag="lbl_plus4" Or rx.Tag="lbl_plus5" Then '<---------line 3123
rx.TextColor=Colors.Black
End If
End If
Next
End If
End If
End Sub
there is a listview on the panel but normally it should not "go up" because its tag is not the correct one.
sometimes the sender is a timer.
I specify that there are 2 timers in this class and that one of them is at 0.1s
apart from this "problem", my class is functioning very well.
I modify it to add functions ...
Thank you and good day,
laurent.
ps:excuse my english, thank you google translate