가능한 중복 :
Access a resource name programmatically문자열에서 자원 ID를 가져
나는 문자열을 그릴 수 ID를 설정하기 위해 노력하고있어,하지만이 작동하지 않습니다 ..
그래서 나는 이것을 시도했다 :
String NoteString = "R.drawable.notebackground".toString();
remoteviews.setImageViewResource(R.id.backgroundImage, context.getResources().getIdentifier(NoteString, "drawable", "com.example.MY-PACKAGE-NAME"));
그러나 이미지가 나타나지 않습니다.
난이 작동 말한다면 :remoteviews.setImageViewResource(R.id.backgroundImage, R.drawable.notebackground);
무슨 일이야?
왜 이렇게 얼마나 그 그냥 아무것도 없도록 이미지 비트 맵을 반환하는 내가, 내가 초보자 해요한다 몰랐 당신의 R.java – JoxTraex
@JoxTraex에 이상이 있는지 확인하지 않습니다 ? – Jakob