Is it possible to reference multiple elements at once?
Ex:
An array with all tags and another array with EditText:
public class Main extends AppCompatActivity {
String[] tags = {"edit1", "edit2", "edit3"};
//Um array de edittext, creio não ser possível, mas é só para o exemplo
EditText[] editText = {edit1, edit2, edit3};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//E então fizer
for (int i = 0; tags.length < i; i++){
editText[i].findViewWithTag( tags[i] );
}
//Assim fazendo referencia a todos editText com um for
}
}
Is there any way to do this? Remembering, this example above the way I did it is not possible, I know, it's because I have over 20 EditTexts in one layout, and I wanted a simpler way to reference them all.
If there is a mode with findViewById, it might be too, but I think findViewWithTag is easier