Back to project page Alkomer.
The source code is released under:
MIT License
If you think the Android project Alkomer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package cz.jmx.tomik.alkomer.android.tools; /*from www. j ava2s . co m*/ import android.content.Context; import android.preference.EditTextPreference; import android.util.AttributeSet; /** * Alkomer - Server App * -------------------- * Customized EditText form for Preferences * (used in settings.xml) * * @copyright Copyright (c) 2011 Tomas Vitek * @author Tomas Vitek ~ http://tomik.jmx.cz * @package Alkomer * @version 1.0 */ public class IntEditTextPreference extends EditTextPreference { public IntEditTextPreference(Context context) { super(context); } public IntEditTextPreference(Context context, AttributeSet attrs) { super(context, attrs); } public IntEditTextPreference(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected String getPersistedString(String defaultReturnValue) { return String.valueOf(getPersistedInt(-1)); } @Override protected boolean persistString(String value) { return persistInt(Integer.valueOf(value)); } }