i have EditText reference set as "dimrix_1" . i have string that has value as "dimrix_1" .
how can i use the string as the reference in case i dont know the value of the string so if it will be "dimrix_2" i would like to refer to "dimrix_2" EditText and so on ...
dimrix_1 = (EditText) mRoot
.findViewById(R.id.dimrix_et);
dimrix_2 = (EditText) mRoot
.findViewById(R.id.dimrix2_et);
dimrix_3 = (EditText) mRoot
.findViewById(R.id.dimrix3_et);
String ManNotNeeded = "dimrix_" + totalNumbers;
now i want go make the editText that match "ManNotNeeded" value to setVisibility(View.GONE)
hope i was clear on the explanation ...
update :
int r = getResources().getIdentifier(
"edit_text_id", "id",
getActivity().getPackageName());
dimrix_1 = (EditText) mRoot
.findViewById(r);
this suggest here but i don't want to use the original xml id . i want to use the reference if possible.