I would like to know if I am doing it correctly. I have many EditText and it is difficult to be casting by casting assigning.
Before this I do the following:
EditText[] Informacion;
Informacion = new EditText[]{
(EditText)findViewById(R.id.informacion_huerto),
(EditText)findViewById(R.id.informacion_ubicacion),
(EditText)findViewById(R.id.informacion_propietario),
(EditText)findViewById(R.id.informacion_fijo),
(EditText)findViewById(R.id.informacion_celular),
(EditText)findViewById(R.id.informacion_productor),
(EditText)findViewById(R.id.informacion_mercado),
(EditText)findViewById(R.id.informacion_ponderado),
(EditText)findViewById(R.id.informacion_descripcion)};
but I mark them null at the time of doing:
Informacion[0].setText("091783172831");
Error!
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference