casting values from an array to the findViewById ids
public String getTexts(int i, int j, String[][] setTexts){
String id = new String();
return id = setTexts[i][j];
}
for (int i = 0; i < weights.length; i++) {
for (int j = 0; j < weights[i].length; j++) {
final EditText setTexts[i][j] =
(EditText)findViewById(R.id.getTexts(i,j,setTexts[][]));
}
}
I used a getter to get a value from a 2d array called "setTexts" that I
created before the shown code, containing the ids of the EditTexts that I
wanted to change. Then when I tried to use the method to get the ids, I
get "unexpected tokens" and a "cannot resolve method "getTexts". I also
tried casting but it didn't work.
No comments:
Post a Comment