join the below group to discuss more http://groups.google.com/group/mobile-application-developers
use like this lv=(ListView)findViewById(R.id.ListView01); lv.setChoiceMode(lv.CHOICE_MODE_SINGLE); lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1 , airport_list)); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { System.out.println("selected item position is = "+position ); System.out.println("selected item is ="+lv.getItemAtPosition(position)); if(list_selected == "arrival") arrival_list_selected=(String) lv.getItemAtPosition (position); else if(list_selected == "depature") depature_list_selected=(String) lv.getItemAtPosition (position); if(airport_selectedby.equals("flightschedule")) flight_schedule(); else if(airport_selectedby.equals("flightstatus")) flight_status(); } }); here lv is a listview. On Aug 28, 5: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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---