from Color to create ColorDrawable - Android Graphics

Android examples for Graphics:Create Color

Description

from Color to create ColorDrawable

Demo Code


//package com.java2s;

import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;

public class Main {
    public static Drawable fromColor(int color) {
        ColorDrawable cd = new ColorDrawable(color);
        return cd;
    }/*w  ww  .  j  a va  2  s.  com*/
}

Related Tutorials