问题描述:

when the activity has been created the spinner setOnItemSelectedListner() event is automatically call.

how to stop this automatic calling.

网友答案:
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
    int count=0;
    @Override
    public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        if(count >= 1){
        //do something
        }
        count++;
    }

    @Override
    public void onNothingSelected(AdapterView<?> arg0) {
    }
});
相关阅读:
Top