public int getResourceId(Resources resources, String resourceName, int resourceType) {
        if (resourceType == RESOURCE_TYPE_DRAWABLE) {
            // Try first in drawable
            int resourceId = getResourceId(resources, resourceName, "drawable");

            // Try in mipmap if not found
            if (resourceId == 0) {
                resourceId = getResourceId(resources, resourceName, "mipmap");
            }

            return resourceId;

            // Get sound, video, etc.
        } else if (resourceType == RESOURCE_TYPE_RAW) {
            return getResourceId(resources, resourceName, "raw");
        }

        // Resource type unknown
        Log.e(TAG, "Unknown resource type: " + resourceType);
        return 0;
    }
Get the resource Id for a given resourceType.
@param resources The resources where to look for, can be {@link Context#getResources()} or {@link Resources#getSystem()}
@param resourceName Can also be a resource path like "res://mySound", "res://myImage.png", etc.
@param resourceType Can be {@link AssetUtil#RESOURCE_TYPE_DRAWABLE} or {@link AssetUtil#RESOURCE_TYPE_RAW}
@return The resource ID or 0 if not found.
src/android/util/AssetUtil.java