Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static void registerViews(Activity act, OnClickListener listener, int... ids) {
        for (int id : ids) {
            View v = act.findViewById(id);
            if (null != v)
                v.setOnClickListener(listener);
        }
    }

    public static void registerViews(Activity act, OnClickListener listener, View... views) {
        for (View v : views) {
            v.setOnClickListener(listener);
        }
    }
}