如果它是空的,我不想显示微调器下拉菜单。我试过了,但我没有得到请任何人都可以帮助我。
代码:
sp.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View arg0, MotionEvent event) {
// TODO Auto-generated method stub
//narray is the array. It's having the elements of spinner.
if (event.getAction() == MotionEvent.ACTION_UP && narray.size() == 0) {
sp.setPressed(false);
sp.setSelected(false);
sp.setAdapter(null);
}
return false;
}
});