Hi,
Why this line code (see title) does not work(see error message)?
But the line code "Dim btn As Button = Activity.GetView(1)" yes?
With other customview it works too.
error message:
Why this line code (see title) does not work(see error message)?
But the line code "Dim btn As Button = Activity.GetView(1)" yes?
With other customview it works too.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim clv As CustomListView = Activity.GetView(0).tag
Log("clv.IsInitialized=" & clv.IsInitialized)
Dim btn As Button = Activity.GetView(1)
Log("btn.IsInitialized=" & btn.IsInitialized)
End Sub
error message:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 353)
java.lang.ClassCastException: java.lang.String cannot be cast to b4a.example3.customlistview
at b4a.example.main._activity_create(main.java:353)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7880)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:568)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)