set View Click Listener - Android User Interface

Android examples for User Interface:Touch Event

Description

set View Click Listener

Demo Code


//package com.java2s;
import android.view.View;
import android.view.View.OnClickListener;

public class Main {
    public static void setClickListener(OnClickListener l, Object... obj) {
        for (int i = 0; i < obj.length; i++) {
            if (obj[i] instanceof View) {
                ((View) obj[i]).setOnClickListener(l);
            }/* www  .  j av a 2s.  c  o m*/
        }
    }
}

Related Tutorials