set View On Click Listener - Android User Interface

Android examples for User Interface:View Click

Description

set View On Click Listener

Demo Code


//package com.java2s;

import android.view.View;
import android.view.View.OnClickListener;

public class Main {
    public static void setOnClickListener(View container, int id,
            OnClickListener listener) {/*w w w . jav  a2  s.  c om*/
        if (container == null)
            return;

        container.findViewById(id).setOnClickListener(listener);
    }
}

Related Tutorials