To receive the value of the selected item in Android spinner

Asked 1 years ago, Updated 1 years ago, 60 views

How do I receive the value of the selected item in Android spinner? I want to get the selected text in the spinner when I press the Save button in the dialog, but I don't know how.

android android-spinner

2022-09-22 11:34

1 Answers

Spinner spinner = (Spinner)findViewById(R.id.spinner);
String text = spinner.getSelectedItem().toString();

Do it like this.


2022-09-22 11:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.