Android Question Get bitmap from listview ?

Devv

Active Member
Licensed User
Longtime User
is it possible to get image list view bitmap ?
ListView1.AddTwoLinesAndBitmap("Item #" & i, "This is the second line.", Bitmap1)
 

mangojack

Well-Known Member
Licensed User
Longtime User
If I understand .. you want to get the image of the listview selected item.

By using AddTwoLinesAndBitmap2 method you can store a return value for item clicks .. unfortunately I don't think you can directly store an image.
You could use a Map to store the Listview items (including Image) and set this as the return object
Then on ListView_Click you can by access the contents of the map retrieving the image ...

See This Thread ..
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
unfortunately I don't think you can directly store an image.

You can store an Object. Any object. You can store an bitmap too. ONLY a Bitmap.

I suggest using a map into the returnvalue. With a Map (or list) you can store any amount of data or objects into one return-value

B4X:
Dim retmap As Map
retmap.Initialize
retmap.Put("id",1)
retmap.Put("line1","this is line 1")
retmap.Put("line2","this is line 2")
retmap.Put("bitmap",bitmap1)
[..]
retmap.Put("othervalue","0815")
lv.AddTwoLines2(cells(0),cells(1), retmap)
 
Upvote 0
Top