How to make the up down list of the preference dialog below? Is it a ListPreference? How to populate the arrays.xml with a range of integer?
Asked
Active
Viewed 599 times
1
-
1it is a [NumberPicker](https://developer.android.com/reference/android/widget/NumberPicker.html). [This Link](https://shanetully.com/2011/12/android-3-x-and-4-x-numberpicker-example/) may be helpful. – Simon Schnell Dec 12 '16 at 14:07
-
Is some of us is answers solved your problem? @Ming Leung – Eren Utku Dec 13 '16 at 06:29
2 Answers
1
That appears to be a custom DialogPreference
, using a NumberPicker
as its content.
See:
- Android PreferenceActivity dialog with number picker
- https://gist.github.com/thom-nic/959884
- https://gist.github.com/lukehorvat/4398028
for various implementations.

Community
- 1
- 1

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
1
You need custom dialog for this action. Create a layout for your custom dialog and you use NumberPicker
class for that. You can check here:
https://stackoverflow.com/a/17944205/4376058