-1
public void Spinner1() {
Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.curso_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(adapter);
}
public void Spinner2() {
Spinner spinner2 = (Spinner) findViewById(R.id.spinner2);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.turma_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner2.setAdapter(adapter);
}
public void Spinner3() {
Spinner spinner3 = (Spinner) findViewById(R.id.spinner3);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.periodo_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner3.setAdapter(adapter);
if ("Redes de Computadores".equals(R.array.curso_array)) {
;
}
}
Could explain your problem better?
– Felipe Avelar
So, I’m making a small form in my android app, but I’m having trouble in the part of Spinner. In this form there are three Spinners, being that it is Course, another one is Period and finally Class. The condition is: If the Course "Networks" item is selected, the Class "Afternoon" item is automatically selected. In both spinners I am using array. I hope I have explained! : D
– Deryty
You explained the condition for the Networks course, but what is the general logic Voce uses to determine what the second and third spinner should show based on what was chosen in the first spinner?
– Math