android 自动触发事件,如何避免在Spinner中自动触发事件:onItemSelected
/*初始化练功对象跟随输入文本框*/arrayAdapterLianGongDuiXiang = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line);arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 1));arrayAdapterLianGon
/*初始化练功对象跟随输入文本框*/
arrayAdapterLianGongDuiXiang = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line);
arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 1));
arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 2));
arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 3));
arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 4));
arrayAdapterLianGongDuiXiang.add(new LianGongDuiXiang(this, 5));
spinnerLianGongDuiXiang.setAdapter(arrayAdapterLianGongDuiXiang);
spinnerLianGongDuiXiang.setOnItemSelectedListener(this);
在上面的代码中,在arrayAdapterLianGongDuiXiang中填充了一些项目。
当将arrayAdapterLianGongDuiXiang和spinner对象关联时:spinnerLianGongDuiXiang.setAdapter(arrayAdapterLianGongDuiXiang);
就会触发spinnerLianGongDuiXiang的OnItemSelectedListener。
如何去除这种关联时的触发啊???
更多推荐
所有评论(0)