onItemSelected / setOnItemSelectedListener not triggering
<blockquote>
  <blockquote>
    <p>I am opening spiiner with onclick on button but my spinner is not
    trigger setOnItemSelectedListener this portion of code is not working   public void onItemSelected(AdapterView arg0, View arg1,
    int pos,
                                    long id) {
                                language = AppConstants.Language_arr[pos];</p>
  </blockquote>

<pre><code>                    }
                    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                        // TODO Auto-generated method stub

                    } spinner opens but onitemselected is not working
</code></pre>
</blockquote>

<pre><code>import com.privy.constants.AppConstants;
            import android.app.Activity;
            import android.os.Bundle;
            import android.view.View;
            import android.view.View.OnClickListener;
            import android.widget.AdapterView;
            import android.widget.AdapterView.OnItemSelectedListener;
            import android.widget.ArrayAdapter;
            import android.widget.Button;
            import android.widget.Spinner;
            import android.widget.ToggleButton;

            public class Settings extends Activity implements OnClickListener {
                private Spinner sp_languge, sp_login;
                private ToggleButton toggle_news_letter;
                private String language;
                private Button language_change;
                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    // TODO Auto-generated method stub
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.settings);
                    sp_languge = new Spinner(this);
                    ArrayAdapter&lt;String&gt; adapter_language = new ArrayAdapter&lt;String&gt;(
                            Settings.this, R.layout.spinner_item, AppConstants.Language_arr);
                    sp_languge.setAdapter(adapter_language);
                    language_change = (Button) findViewById(R.id.language_change);
                    language_change.setOnClickListener(this);
                    sp_languge.setOnItemSelectedListener(new OnItemSelectedListener() {

                        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int pos,
                                long id) {
                            language = AppConstants.Language_arr[pos];

                        }
                        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                            // TODO Auto-generated method stub

                        }
                    });
                }
                public void onClick(View v) {
                    if (v == language_change) {

                        sp_languge.performClick();

                    }
                }
            }
</code></pre>
