Hi,
I'm using this ImageSlider by @Erel .
I want to add this image slider to a Panel from code. Like this:
But I'm getting this error:
What is the correct way to add this ImageSlider from code?
I'm using this ImageSlider by @Erel .
I want to add this image slider to a Panel from code. Like this:
B4X:
Dim StoreBanner As ImageSlider
StoreBanner.Initialize(Me,"Banner")
PageScroll.Add(StoreBanner,"") 'PageScroll is a CustomListView
But I'm getting this error:
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (storeinner) Create, isFirst = true **
** Activity (storeinner) Resume **
Error occurred on line: 212 (CustomListView)
java.lang.ClassCastException: in.quest.main.imageslider cannot be cast to android.view.View
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:68)
at anywheresoftware.b4a.objects.B4XViewWrapper.getHeight(B4XViewWrapper.java:124)
at in.quest.main.customlistview._insertat(customlistview.java:256)
at in.quest.main.customlistview._add(customlistview.java:96)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:733)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:355)
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.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at in.quest.main.storeinner._showstore(storeinner.java:478)
at in.quest.main.storeinner._loadstore(storeinner.java:470)
at in.quest.main.storeinner._activity_resume(storeinner.java:442)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:733)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:355)
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.raiseEvent(BA.java:171)
at in.quest.main.storeinner.afterFirstLayout(storeinner.java:110)
at in.quest.main.storeinner.access$000(storeinner.java:17)
at in.quest.main.storeinner$WaitForLayout.run(storeinner.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
What is the correct way to add this ImageSlider from code?