Questions tagged [android-number-picker]

A widget that enables the user to select a number from a predefined range. There are two flavors of this widget and which one is presented to the user depends on the current theme.

A widget that enables the user to select a number from a predefined range. There are two flavors of this widget and which one is presented to the user depends on the current theme.

  • If the current theme is derived from Theme the widget presents the current value as an editable input field with an increment button above and a decrement button below. Long pressing the buttons allows for a quick change of the current value. Tapping on the input field allows to type in a desired value.
  • If the current theme is derived from Theme_Holo or Theme_Holo_Light the widget presents the current value as an editable input field with a lesser value above and a greater value below. Tapping on the lesser or greater value selects it by animating the number axis up or down to make the chosen value current. Flinging up or down allows for multiple increments or decrements of the current value. Long pressing on the lesser and greater values also allows for a quick change of the current value. Tapping on the current value allows to type in a desired value.

Useful links

105 questions
0
votes
1 answer

Trying to setup a NumberPicker to show value in Toast

I'm using the NumberPicker tool in Android and I changed the value of the integer to String to be able to show it in the Toast I used Integer.toString method but I don't think the problem is that. The thing is when I tap my button no matter what…
0
votes
0 answers

NumberPicker does not appears correctly on an Android 4.4.2

I'm having some issues with the number picker on an Android 4.4.2. Sometimes it shows only a blue bar, sometimes nothing. See pictures below: I've tested on an emulator with Android 4.4.2, its works perfectly. It should appears as follows: An…
Hubert Solecki
  • 2,611
  • 5
  • 31
  • 63
0
votes
1 answer

How to make Number Picker increase by Specific value in android with good design

i have to make NumberPicker to make user choose between 0 - 4 but not increase every time by one ... i need to increase it by 0.05 like (0.05 - 0.1 - 0.15 - .... - 3.95 - 4) and which attributes make numberpicker look good in design Thanks in…
0
votes
1 answer

Android NumberPicker setValue does not work with setDisplayedValues

I am incrementing values in android NumberPicker by 5, however when I call setValue method, it doesn't seem to work when used together with setDisplayedValues. My code is below, any help is appreciated: String[] numberValues = new…
yinjia
  • 804
  • 2
  • 10
  • 20
0
votes
0 answers

Android NumberPicker Plus/Minus Signs Not Centered

I created a dialog with a NumberPicker, however I can't center plus and minus signs. Here is my code and the image, any help is appretiated!
yinjia
  • 804
  • 2
  • 10
  • 20
0
votes
1 answer

Android: Disabling/removing date from DatePicker dialog

One of my features require the user to select a month and year, so the following is the method which will pop up the first attached image (d/m/y). final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); …
Zhi Kai
  • 1,549
  • 1
  • 13
  • 31
0
votes
1 answer

Custom preference isPersistent()

I wrote my own number picker preference using android's brief guide and some googling. My question is regarding the onSaveInstanceState() method. On google's tutorial, it is suggested that we use the method isPersistent() to determine if the…
0
votes
2 answers

How to add :00 to NumberPicker in Android?

I have a NumberPicker which should represent hours. How can I add the :00 after the number? Or is there another way? Here's the code: hourPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS); …
jlively
  • 735
  • 2
  • 9
  • 29
0
votes
1 answer

How to call NumberPicker's onvaluechange from SharedPreferences?

I want to update the NumberPicker using the value stored in Shared Preferences. This is all happening inside a fragment, there is also a button which calls the onValueChange() method whenever the user clicks on it. HomeFragment.java import…
gegobyte
  • 4,945
  • 10
  • 46
  • 76
0
votes
1 answer

How to convert a string to long number with 3 decimals in Android using NumberPicker

I have 4 number pickers and I concat as string the 4 numbers How I am going to convert this into long I using the following String decimals=units2.concat(units3).concat(units4); String units = units1; String finalGrade = units1+decimals; long Grade…
Miaoulis Nikos
  • 182
  • 1
  • 15
0
votes
0 answers

Have Android contains number selection control?

I want to use some dialog control like this (image with calendar or time dialog): number selection dialog.User can select one of set of numbers (0-9) and the latest choise will be commit. Have Android some controls like i want? Or i should implement…
Admiral Land
  • 2,304
  • 7
  • 43
  • 81
0
votes
2 answers

Setting spinner value depending on number picked?

I am not sure if this is the right way, I need some help to solve this problem.I want to select a number from the NumberPicker. After selecting, I expect the setOnValueChangedListener to be able to capture the value and run a for loop and store the…
topacoBoy
  • 197
  • 2
  • 4
  • 17
0
votes
1 answer

Number Picker calculaiton

I have create the 3 different number picker, I'm using the 3 different number selected to do calculation, but don't know why it wont show the total sum in the totalP textView. Is that this 2 line is wrong ? "sum =(a*4)+(b*4)+(c*9); " and …
Wg Sam
  • 61
  • 1
  • 2
  • 11
0
votes
1 answer

Passing number from 1st activity to the number picker

This is my 1st activity public void onClick(View v) { switch (v.getId()) { case R.id.setButton: int cpv= carbPValue; int ppv = proteinPValue; int fpv=fatPValue; …
Wg Sam
  • 61
  • 1
  • 2
  • 11
0
votes
2 answers

Android NumberPicker setMin/Max

I try to set min/max on NumberPicker. I have following values: One, Two, Three, Four I set picker.setMinValue(0); picker.setMaxValue(1); the picker will display One, Two However when I set picker.setMinValue(1); picker.setMaxValue(1); it…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
1 2 3 4 5 6
7