Android examples for User Interface:View Click
clean Up View On Click Listeners
//package com.java2s; import android.view.View; import android.widget.AdapterView; public class Main { @SuppressWarnings({ "rawtypes" }) private static void cleanUpOnClickListeners(View view) { if (view instanceof AdapterView) { ((AdapterView) view).setOnItemClickListener(null); ((AdapterView) view).setOnItemLongClickListener(null); ((AdapterView) view).setOnItemSelectedListener(null); } else {/*from w ww. j a v a 2 s .c om*/ view.setOnClickListener(null); view.setOnLongClickListener(null); view.setOnTouchListener(null); } } }