You can register public abstract void onItemSelected (AdapterView<?> parent, View view, int position, long id) and to retrieve the selected value from ArrayAdapter.getItem(int position) using the selected position as parameter.
On Fri, Aug 28, 2009 at 3:35 PM, ragavendran s<sraghav.ra...@gmail.com> wrote: > i m a beginner for Android development.... > > How i get the Selected item from the list Adapter. > > for example i m having the code: > > > > Code: > > final Spinner spinner = (Spinner) findViewById(R.id.testSpinner); > ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, > android.R.layout.simple_spinner_item, Months); > > adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); > spinner.setAdapter(adapter); > > > > /-----------some code--------/ > > static final String[] Months = new String[]{ > "January","February","March","April","May","June","July","August", > "September","October","November","December" > }; > > > > public void changeOption(Spinner spinner){ > if (spinner.isEnabled()){ > spinner.setEnabled(false); > > > > } > else{ > spinner.setEnabled(true); > } > } > > > Question: > > In this above code if i selected March from the Dropdown Adapter means then > how can i retrieve the Manth March to show in a textview. > > Please tell me the ANswer... > > > with Regard, > Raghav.S > > > > -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---