Example usage for android.content.res Resources getResourceEntryName

List of usage examples for android.content.res Resources getResourceEntryName

Introduction

In this page you can find the example usage for android.content.res Resources getResourceEntryName.

Prototype

public String getResourceEntryName(@AnyRes int resid) throws NotFoundException 

Source Link

Document

Return the entry name for a given resource identifier.

Usage

From source file:com.onegravity.contactpicker.core.ContactPickerActivity.java

/**
 * This method makes sure that all mandatory style attributes are defined for the current theme.
 */// w  w w . j  av a 2 s . c om
private boolean checkTheming() {
    if (sThemingChecked) {
        return true;
    }

    Resources.Theme theme = getTheme();
    Resources res = getResources();
    TypedValue typedValue = new TypedValue();

    int[] resIds = getStyleableAttributes("ContactPicker");
    for (int resId : resIds) {
        String resName = res.getResourceEntryName(resId);
        boolean exists = theme.resolveAttribute(resId, typedValue, true);
        if (!exists) {
            themeFailure(resName);
            return false;
        }
    }

    sThemingChecked = true;
    return true;
}