My spinner coding is something like this:
assetSpinner = (Spinner) findViewById(R.id.editAsset);
assetAdapter = ArrayAdapter.createFromResource(
this, R.array.asset_array, android.R.layout.simple_spinner_item);
assetAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
assetSpinner.setAdapter(assetAdapter);
Now I have a reset button in my design. So my question is when I click on reset button how to make the spinner get back to default value or reset the spinner.
You can using Spinners setSelection
attribute to reset your Spinner to its original position. spinner.setSelection(position);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With