I was working and every thing was fine then i started to get this error without changing anything in the project
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 156 (Main)
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.ImageView
at anywheresoftware.b4a.objects.ImageViewWrapper.getGravity(ImageViewWrapper.java:43)
at anywheresoftware.b4a.objects.ImageViewWrapper.setBitmap(ImageViewWrapper.java:76)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Dim pnl As Panel
pnl = clv2.GetPanel(x) 'index of the clicked row or knowing which row item you wish to edit
Dim imv As ImageView
imv = pnl.GetView(0) ' 0 = first view added to panel/row ... 1 = 2nd view etc (refer Sub CreateListItem)
If clv2.GetValue(x) = AsyncDownloader.FileName Then
imv.Bitmap = LoadBitmap(File.DirInternalCache,AsyncDownloader.FileName)
End If
I would try creating the panel again; also, setting the Tags of the views, you can debug your sw better:
B4X:
Dim pnl As Panel
pnl = clv2.GetPanel(x) 'index of the clicked row or knowing which row item you wish to edit
' Dim imv As ImageView
Dim V as View = pnl.GetView(0)
Log(GetType(V) & Tab & V.Tag)