R.java 를 참조하지 않고 리소스 얻어오기
getIdentifier 의 첫번째 인자 는 리소스 이름
두번째 인자 "string" 같은경우
resource xml 의 element 이름 적어주거나
"drawable" 로 Drawable도 얻어올수 있다.
int resId = context.getResources().getIdentifier(resName, "string", context.getPackageName());
String str = context.getString(resId);
= context.getResouces().getString(resId);
int resId = context.getResources().getIdentifier(resName, "drawable", context.getPackageName());
Drawable = context.getResources().getDrawable(redId);
String str = context.getString(resId);
= context.getResouces().getString(resId);
int resId = context.getResources().getIdentifier(resName, "drawable", context.getPackageName());
Drawable = context.getResources().getDrawable(redId);
getIdentifier 의 첫번째 인자 는 리소스 이름
두번째 인자 "string" 같은경우
resource xml 의 element 이름 적어주거나
"drawable" 로 Drawable도 얻어올수 있다.
TAG android


댓글을 달아 주세요
음... 아직은 내가 아무것도 몰라서;;;
이거 봐도 무슨 말인지 모르겠다 ㅋㅋ
지금 열심히 책봐야지
ㅎㅎ 별로 쓸일없는거예요 ㅋ; 열공~!!
별로 쓸일이 없어도...
나중에 궁금한거 있으면 물어볼께 ㅋㅋㅋ
나중에 모른척하고 안갈쳐주면 안데~ㅋㅋ
ㅎㅎ;; 알면 갈쳐주는거고 모르면 모르는거고 머; ㅎㅎ
블로그로 퍼갈게요~~ 비공개로
ㅎㅎ 네~
담아갈게요~^^