아래처럼 소스를 적용해봤습니다. 왜 안되는지 알수가 없내요
res/drawable/main_480_800.png (이미지를 읽어올려고 합니다.)
ImageView iv_intro_img = (ImageView)findViewById(R.id.iv_intro_img);
long width = getAppWidth(); //480
long height = getAppHeight(); //800
String imgId = "main_"+width+"_"+height; //main_480_800
int resId = getResources().getIdentifier(imgId, "drawable",getPackageName());
// int resId = getResources().getIdentifier(getPackageName()+":drawable/main_"+width+"_"+height, null,null);
System.out.println(" resId = ["+resId+"]"); <-- resId = [2130837508]
R.java에 있는 public static final int main_480_800=0x7f020004; 이놈과 틀립니다... ^^;
Drawable draw = getResources().getDrawable(resId);
iv_intro_img.setBackgroundDrawable(draw); <---- NullPointerException 발생
Caused by: java.lang.NullPointerException
이게 적용이 되긴 하는건가요?




resId = 2130837508 = 0x7f020004