如何检查整数数组中的android资源类型

pfo*_*oof 3 android drawable android-resources

我想知道是否有可能在这样的资源数组中确定android资源类型(如drawable,raw):

public static final int[] resourcesArray = {
R.drawable.image1,
R.raw.image2,
R.drawable.image3
};
Run Code Online (Sandbox Code Playgroud)

Raf*_*l T 5

尝试

Resources resources = context.getResources();
String res = resources.getResourceTypeName(resid);
if (res.equals("drawable")){
    ....
}
Run Code Online (Sandbox Code Playgroud)