set Child View Background Drawable - Android User Interface

Android examples for User Interface:View Child

Description

set Child View Background Drawable

Demo Code


//package com.java2s;

import android.graphics.drawable.Drawable;
import android.view.View;

public class Main {
    @SuppressWarnings("deprecation")
    public static void setBackgroundDrawable(View container, int id,
            Drawable drawable) {/*from ww  w  . ja  v a 2s. co  m*/
        if (container == null)
            return;

        container.findViewById(id).setBackgroundDrawable(drawable);
    }
}

Related Tutorials