Code example for TypedArray

Methods: getInteger

0
    } 
     
    @Override 
    protected Object onGetDefaultValue( TypedArray a, int index )
    { 
        return a.getInteger( index, DEFAULT_VALUE );
    } 
     
    @Override 
    protected void onSetInitialValue( boolean restorePersistedValue, Object defaultValue )
    { 
        try 
        { 
            setValue( restorePersistedValue ? getPersistedInt( mValue ) : (Integer) defaultValue );
        } 
        catch( ClassCastException e )
        { 
            // Using an obsolete file for persistence 
            Log.w( "CheatPreference", "Failure setting initial value", e );
            setValue( DEFAULT_VALUE );
Stop searching for code, let great code find you!  Add Codota to your java IDE