get Type Of Drawable - Android Graphics

Android examples for Graphics:Drawable

Description

get Type Of Drawable

Demo Code


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

public class Main {
    public static String getTypeOfDrawable(int drawableId, Context context) {
        Drawable resImg = context.getResources().getDrawable(drawableId);
        return resImg.getClass().toString()
                .replace("class android.graphics.drawable.", "");
    }//from ww  w.j a v a 2s . co m
}

Related Tutorials