I tried this way more is returning 0
try {
String nome_foto = itens.get(position).nome_foto;
int drawableId = context.getResources().getIdentifier(nome_foto, "drawable", context.getPackageName());
Log.e("",""+drawableId+" "+R.drawable.bertioga1+" "+nome_foto);
imagem.setImageResource(drawableId );
}