get Drawable from Context - Android android.graphics.drawable

Android examples for android.graphics.drawable:Drawable

Description

get Drawable from Context

Demo Code

import android.content.Context;
import android.graphics.drawable.Drawable;

public class Main {

  public static Drawable getDrawable(Context context, int drawableId) {
    return context.getResources().getDrawable(drawableId);
  }//from w w  w  .  j av a  2s .co m

}

Related Tutorials