create Placeholder from Drawable - Android Graphics

Android examples for Graphics:Drawable Operation

Description

create Placeholder from Drawable

Demo Code


//package com.java2s;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;

public class Main {
    private static Drawable createPlaceholder(Drawable original) {
        Drawable placeholder = new ColorDrawable();
        placeholder.setBounds(original.getBounds());
        return placeholder;
    }//  ww  w  . j ava2 s  .c o m
}

Related Tutorials