In my application I use spinner, it shows with spinner.performClick() . After many attempts, I noticed that my code does not run the onItemSelected method . Then I tried to add the @Override annotation, but it returns as an error and says delete this annotation. here is this code:
Spinner colorSpinner = new Spinner(this); ColorFriendsSpinnerAdapter adapter = new ColorFriendsSpinnerAdapter(getApplicationContext(), liste, R.layout.color_dropdown, new String[] { "Icon" }, new int[] { R.id.colorDropdown }); //adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); colorSpinner.setAdapter(adapter); colorSpinner.performClick(); colorSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) { editColorXml(position); } public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } });
Thanks for any help and sorry for my english.
Utk12 source share