i have two spinners when i select items(other then first item) in first spinner which is saved in array it populates data in spinner second which comes from web services. i want that when i again select first data which is title of spinner first it should clear all the value from spinner second. i did all tricks but helpless. suggest me.
my code is:
if(spinner1== 0) {
spinner2List.clear();
ArrayAdapter<String> adapterEmpty = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, spinner2List);
adapterEmpty.setDropDownViewResource(R.layout.spinner_layout);
// Apply the adapter to the spinner
spinner2.setAdapter(adapterEmpty);
}
thanks.