FreeRDP
Loading...
Searching...
No Matches
IntListPreference.java
1/*
2 ListPreference to store/load integer values
3
4 Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9*/
10
11package com.freerdp.freerdpcore.utils;
12
13import android.content.Context;
14import android.preference.ListPreference;
15import android.util.AttributeSet;
16
17public class IntListPreference extends ListPreference
18{
19
20 public IntListPreference(Context context)
21 {
22 super(context);
23 }
24
25 public IntListPreference(Context context, AttributeSet attrs)
26 {
27 super(context, attrs);
28 }
29
30 @Override protected String getPersistedString(String defaultReturnValue)
31 {
32 return String.valueOf(getPersistedInt(-1));
33 }
34
35 @Override protected boolean persistString(String value)
36 {
37 return persistInt(Integer.parseInt(value));
38 }
39}