update ImageButton View - Android User Interface

Android examples for User Interface:ImageButton

Description

update ImageButton View

Demo Code


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

import android.widget.ImageButton;

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

            if (null != button)
                button.setOnClickListener(onClickListener);
        }//from www. ja v  a2s  .c  o m
    }
}

Related Tutorials