android控件监听管理工具
Map data; private void cancelListener(){ for(Map.Entry entry:data.entrySet()){ View v = (View) entry.getKey(); v.setOnClickListener(null); } } private void registerLisntener(){ for(Map.Entry entry:data.entrySet()){ View v = (View) entry.getKey(); OnClickListener c = (OnClickListener) entry.getValue(); v.setOnClickListener(c); } }
用户评论