update Button View - Android User Interface

Android examples for User Interface:Button

Description

update Button View

Demo Code


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

public class Main {
    public static void updateButton(View view, int id,
            OnClickListener onClickListener) {
        if (null != view) {
            Button button = (Button) view.findViewById(id);

            if (null != button)
                button.setOnClickListener(onClickListener);
        }//from  ww w .j  a  va2 s .c  o  m
    }
}

Related Tutorials