Good, I have a problem and I have been researching and I have not found a solution, the problem is the following, wanting to get the value of an edittext that I have added dynamically stops my application and shows me the following error
java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference
and the following code is where it is used to appear the views
private void agregarSpinner(View view){
View infla = View.inflate(getActivity(),R.layout.nuevos_spinner_materiales,layout);
Spinner spinnerMateriales2 = (Spinner) view.findViewById(R.id.spinner2);
spinnerMateriales2.setAdapter(adapter);
}
and when reading the error I realize the problem, what happens that I do not know how to initialize the views that I add to obtain its value