Code example for TypedArray

Methods: getInteger

    protected Object onGetDefaultValue(TypedArray a, int index) {
        // This preference type's value type is Integer, so we read the default 
        // value from the attributes as an Integer. 
        return a.getInteger(index, 0);
    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
        if (restoreValue) {
            // Restore state 
            mClickCounter = getPersistedInt(mClickCounter);
        } else { 
            // Set state 
            int value = (Integer) defaultValue;
            mClickCounter = value;
Connect your IDE to all the code out there  Get Codota for Java