I would like to know how to get the id of an image from the drawable folder and use it in an ImageView. I'm trying to do this inside a ListView
String nomeImgFilme = filme.getImagem();
int imgID = convertView.getResources().getIdentifier(nomeImgFilme, "drawable", context.getPackageName());
I'm trying to run this code, but it gives error:
"Resources $ NotFoundException: Resource ID # 0x7f060054".
And if I put the image directly with "R.drawable.circulo_fogo", it also says that it was not found.
So how do I get the id of an image by name inside a ListView?