Hi,

Has anyone seen a a onItemSelected not being called when using a
spinner inside a listviewActivity. I have the code below Inside a
listViewActivity.

     protected void onCreate(Bundle savedInstanceState){
         super.onCreate(savedInstanceState);
         setContentView(R.layout.listview);

         Spinner sortOption = new Spinner(this);
         String[] items = CursorCollection.getSortOptions(this);
         sortOption.setOnItemSelectedListener(this);
         ArrayAdapter<String> adapter = new
ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,
items);
 
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

              searchButton.setOnClickListener(new OnClickListener() {

                        public void onClick(View v) {
                                sortOption.performClick();
                        }
                });



     }

   public void onItemSelected(AdapterView<?> parent, View v, int
position, long id) {
                Log.V("Info", "Doing some stuff");
     }

The spinner is shown on screen by pressing a button (not the spinner)
which in turn calls performClick() on the spinner. When I select an
item from the spinner the onItemSelected function is not called. Does
anyone know why this might be?

-- 
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

Reply via email to