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)
尝试
Resources resources = context.getResources();
String res = resources.getResourceTypeName(resid);
if (res.equals("drawable")){
....
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
821 次 |
| 最近记录: |