Android Question Changing image in customlistview

Devv

Active Member
Licensed User
Longtime User
i saw lots of examples on this site but i still can understand how to edit and image in a customListView

my customlist have images and at any time i want to change the image

the problem is that there is only one imageview how can choose what image i want to change ?

B4X:
ImageView1.SetBackgroundImage(LoadBitmap(File.DirInternalCache,"myimage.jpg"))

any ideas ?
 

mangojack

Expert
Licensed User
Longtime User
You have to get the clv row item panel first, then get the panel imageview ... ie.
B4X:
Dim pnl As Panel
pnl = clv1.GetPanel(index)   'index of the clicked row  or knowing which row item you wish to edit

Dim imv As ImageView
imv =  pnl.GetView(1)        ' 0 = first view added to panel/row ... 1 = 2nd view etc (refer Sub CreateListItem)
imv.Bitmap = MyNewBitmap     ' or LoadBitmap(File.DirInternalCache,"mynewimage.jpg"))
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
You have to get the clv row item panel first, then get the panel imageview ... ie.
B4X:
Dim pnl As Panel
pnl = clv1.GetPanel(index)   'index of the clicked row  or knowing which row item you wish to edit

Dim imv As ImageView
imv =  pnl.GetView(1)        ' 0 = first view added to panel/row ... 1 = 2nd view etc (refer Sub CreateListItem)
imv.Bitmap = MyNewBitmap     ' or LoadBitmap(File.DirInternalCache,"mynewimage.jpg"))


Thanks you !
 
Upvote 0
Top