how to pass time Interval in list pref option
Posted
by
user1748932
on Stack Overflow
See other posts from Stack Overflow
or by user1748932
Published on 2012-10-30T10:40:04Z
Indexed on
2012/10/30
11:01 UTC
Read the original article
Hit count: 126
android
<ListPreference
android:entries="@array/listOptions2"
android:entryValues="@array/listValues2"
android:key="listprefrefresh"
android:summary="set Refresh The Applciation"
android:title="Set TIme Intervale" />
<item>10 </item>
<item>30</item>
</integer-array>
<integer-array name="listValues2">
<item>10000</item>
<item>30000</item>
</integer-array>
public static final String PREF_BEER_SIZE2 = "listprefrefresh"; Preference beerPref2 = (Preference) findPreference(PREF_BEER_SIZE2); beerPref2 .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference,
Object newValue) {
// TODO Auto-generated method stub
final ListPreference listrefresh = (ListPreference) preference;
final int idx = listrefresh
.findIndexOfValue((String) newValue);
if (idx == 0 ) {
handler.post(timedTask);
//
} else if (idx == 1) {
// System.out.println("2");
}
return true;
}
});
This is my code i want Pass Time how can i implement right now? I am passing Integr value.please tell me
© Stack Overflow or respective owner