1

in my application I must to use a button over a spinner opened by the click on the button. For open the spinner I use the code:

button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            spinner.performClick();
        }
    });

And in the spinner I must use an ItemSelectListener:

spinnerArray = new ArrayList<String>();
    spinnerArray.add("EN");
    spinnerArray.add("PR");

    holder.spinnerLenguage.setAdapter(new lenguageSpinnerAdapter(
            convertView.getContext(), spinnerArray));
holder.spinnerLenguage
            .setOnItemSelectedListener(new OnItemSelectedListener() {

                @Override
                public void onItemSelected(AdapterView<?> arg0, View v,
                        int position, long arg3) {
...
...
...
}

But in my application the two events have problems, because button opens the spinner continuously and automatically selects the first item. How can I solve this problem?

4

0 回答 0