android - Resource ID is not returning correct value -


i having difficulty displaying images in listview.

the output want should contain different images different list items. getting this:

screenshot

as can see icons being displayed same (booking). figure out until method itemimagesviews.setimageresource(itemsimages.getresourceid(position, r.drawable.booking)) itemadapter.java file not returning expected value.

here repo:

https://github.com/amar0891/aroma-holiday

i don't know code in itemadapter.java. need this, if want see booking icon:

itemimagesviews.setimageresource(r.drawable.booking); 

note: don't know code setup have getresourceid() , maybe main problem.

another solution, recommended google, think is:

resources resources = getresources(); itemimagesviews. setimagedrawable(resources.getdrawable(r.drawable.myfirstimage)); 

note: itemimagesviews imageview. setimagedrawable method supposed more efficent large images.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -