android - OnItemSelectedListener not working for spinner -


itemprop = "text">

I have a spinner that I set up using a custom ArrayAdapter:

  Private static Class Custom Adapter & lt; T & gt; Extension of array adapter & lt; String & gt; {Public Custed Adapter (Reference Reference, Int TextVersourceSource Id, String [] Objects) {Super (context, text WEVRSourceID, Objects); } View public ViewViewView (View int Status, see ViewGroup Parents) {View View = super.getView (Status, ConvertView, Parents); TextView textView = (TextView) view.findViewById (android.R.id.text1); TextView.setText (""); Return view; }  

It has been started as (spinner spinner; statement is above the class variable):

  this.spinner = (spinner ) FindViewById (R.id.spinner1); CustomAdapter & LT; String & gt; Adapters = new custom adapter & lt; String & gt; (This, android.R.layout.simple_spinner_dropdown_item, new string [] {"set home page"}); Spinner.setAdapter (adapter); Spinner.setOnItemSelectedListener (this);  

I have implemented Onim Select Listener:

  increases the public class main activity activity tools IItemSelectedListener {...}  

and the required callbacks are:

  // spinner methods @ override selected items on public zeros (adapterview & lt;? & Gt; parent, see view, int paus , Long ID) {// Tudo Auto-Generated Method Stub // if (pos == 1) {toast.makeText ("This person wants to change the homepage", Toast. LNGHI HRARAR). Show (); //}} @ Override public zeros on any selection (adapterview  

XML for spinner:

  Android spinner: id = "@ + id / spinner1" Android: layout_width = "45dp" Android: Layout_height = "45dp" Android: background = "@drawable / ic_menu_motoroverflow_holo_dark" />  

The problem is that whenever any item is chosen from the spinner, nothing happens, even I have removed all the conditions as you can see above Are there.

OnTime is not working for simplified listener spinner

Because you are passing only one item in the adapter selected by default, maybe you are getting toast messages when launching your application.

To add more elements to check onItemSelectedListener behavior.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -