String buttonID = "resolution_btn_" + idx ;
int resID = getResources().getIdentifier(buttonID, "id", getActivity().getPackageName());
Button view = ((Button) mRootView.findViewById(resID));
실제 id 값들
{R.id.resolution_btn_0, R.id.resolution_btn_1, R.id.resolution_btn_2, R.id.resolution_btn_3, R.id.resolution_btn_4, R.id.resolution_btn_5, R.id.resolution_btn_125}
'Study > Android' 카테고리의 다른 글
[Android] KEY_CODE 표 (0) | 2019.06.12 |
---|---|
[android] toolbar 그림자 (0) | 2019.06.12 |
[Android] 갤러리, 사진촬영, CircularImageView (0) | 2019.06.12 |
[Android] shape xml (0) | 2019.06.10 |
[Android] HashMap에서 키가 있는지 값이 있는지 확인 하기 (0) | 2019.06.10 |