Android Drawable Create getDrawableById(Context paramContext, String paramString)

Here you can find the source of getDrawableById(Context paramContext, String paramString)

Description

get Drawable By Id

License

Open Source License

Declaration

public static Drawable getDrawableById(Context paramContext,
            String paramString) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.graphics.drawable.Drawable;

public class Main {
    public static Drawable getDrawableById(Context paramContext,
            String paramString) {
        return paramContext.getResources().getDrawable(
                getDrawableId(paramContext, paramString));
    }/*from ww w. j a  v a  2  s .c  o  m*/

    public static int getDrawableId(Context paramContext, String paramString) {
        return paramContext.getResources().getIdentifier(paramString,
                "drawable", paramContext.getPackageName());
    }
}

Related

  1. loadDrawable(final String imageUrl, final ImageView imageView, final ImageCallback imageCallback)
  2. getDrawableFromUrl(String url)
  3. getPressedDrawable(int color)
  4. getDrawableByName(Context ctx, String name)
  5. getDrawable(final Context context, final String packageName, final int resourceID)