Add an item of a spinner inside a table and show information of spinners depending on one previously selected

-1

What about guys, I hope you can help me, I have 3 spinners and I want the information that shows spinner 3 depends on spinner 2 and spinner 2 depends on spinner one.

After selecting the third spinner, click on the button and add information in a table, and continue selecting and adding without losing the information added in the table.

I need your help guys please.

    
asked by Charlie 09.05.2017 в 19:51
source

1 answer

0

To start you need a listener for each spinner. Inside the listener you get the selected item and use it to fill the second spinner, and so on.

spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) 
{
    String selectedItem = parent.getItemAtPosition(position).toString();  
//this is your selected item
}
public void onNothingSelected(AdapterView<?> parent) 
{

}           
});
    
answered by 10.05.2017 в 01:30