안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
ImageButton mBtnImgThumnail_1;
mBtnImgThumnail_1 = (ImageButton)findViewById(R.id.date_read_gallery_thumnail_1);
ImageButton mBtnImgThumnail_2;
mBtnImgThumnail_2 = (ImageButton)findViewById(R.id.date_read_gallery_thumnail_2);
..........................
ImageButton mBtnImgThumnail_10;
mBtnImgThumnail_10 = (ImageButton)findViewById(R.id.date_read_gallery_thumnail_10);
for(int i=1; i<=10; i++){
객체명을 {"mBtnImgThumnail_"+i}.set......................... 이렇게 사용하고 싶습니다....
}
가능한가요?
생성할 때 ImageButton[]로 만드시는게 어떨런지요 ^^