In my custom view I load layouts. The first one contains a Panel and in it is a Label. Reading the Label is no problem.
The second one contains a Panel and in it an Imageview. Loading the ImageView is with an error
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.ImageView
B4X:
tilesPanel.LoadLayout("_pnlLabel")
Dim pnl As Panel
pnl = tilesPanel.GetView(0)
Dim lbl As Label = pnl.GetView(0)
lbl.Width = pnl.Width
lbl.Height = pnl.Height
lbl.Text = pText
B4X:
tilesPanel.LoadLayout("_pnlImage")
Dim pnl As Panel
pnl = tilesPanel.GetView(0)
Dim img As ImageView = pnl.GetView(0)
img.Width = pnl.Width
img.Height = pnl.Height
img.Bitmap = LoadBitmap(File.DirAssets, pBitmap) - error
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.ImageView