Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.graphics.drawable.Drawable; public class Main { public static Drawable getDrawable(Context context, int R_ID) { Drawable brawable = context.getResources().getDrawable(R_ID); brawable.setBounds(0, 0, brawable.getMinimumWidth(), brawable.getMinimumHeight()); return brawable; } }