| [개발 Tip] 리소스명으로 해당 리소스 ID 구하기 |
|
|
 |
10년 전 |
int id;
testImg = new Bitmap[10];
for(int i = 0; i < 10; i++)
{
id = res.getIdentifier( "testRes"+i, "drawable" , "com.androboy.android.test");
testImg[i] = BitmapFactory.decodeResource(res, id);
}
정리:
다음과 같이 리소스명으로 ID를 얻어올수가 있다.
"패키지명 : 타입 / 리소스명", null, null
getIdentifier("com.androboy.android.test:drawable/testRes", null, null);
|
|
추천 : 422 |
추천
목록
|
|