Code example for InvalidPreferencesFormatException

0
     * @throws InvalidPreferencesFormatException 
     */ 
    public static int getBrightness(String preference) throws InvalidPreferencesFormatException {
    	String[] values = preference.split(":");
    	if (values.length != 2) {
    		throw new InvalidPreferencesFormatException(preference);
    	} 
    	 
    	return Integer.parseInt(values[1]);
    } 
 
    /** 
     * Get brightness mode from preference string. 
     * @param preference 
     * @return 
     * @throws InvalidPreferencesFormatException 
     */ 
    public static int getBrightnessMode(String preference) throws InvalidPreferencesFormatException {
    	String[] values = preference.split(":");
    	if (values.length != 2) {
    		throw new InvalidPreferencesFormatException(preference);