Questions tagged [numberpicker]

A Number Picker is a UI element that lets the user pick a numeric value.

NumberPickers define the input value to be numbers and optionally some other numeric characters, like . or -.

This definition is useful for input sanitation, and it allows mobile devices to show a numeric-only keyboard when the input field is edited.

Examples:

353 questions
7
votes
3 answers

Android NumberPicker wraps values when displayed values are changed

I have an android Dialog with a 3 numberpickers inside. Changing the 3rd picker triggers a change in the displayed values of the first 2 pickers. However I've noticed when I change the displayed values, and call setWrapSelectorWheel(false) it…
Prometheus3k
  • 133
  • 2
  • 7
7
votes
2 answers

How to use NumberPicker in Android app with API 7?

The minimum sdk of my app is 7, but I can use DialogFragment which is from sdk version 11, because it is in the support library which is in my lib directory. I'd like to make something like this example:…
6
votes
2 answers

Android Number Picker get value to textview

I am using an alert dialog with a number picker, but I don't know a easy way to get te number picker value to an textview in the activity when I press the OK button of the alert. Activity java code: public class SecondActivity extends Activity…
user3618526
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

Android Loading Custom Number Picker Drawable [Image Inside]

On the left is the default Number Picker by android. Is it possible to load a custom number picker like on the right, if I have the drawable images?
Zen
  • 2,524
  • 3
  • 19
  • 40
6
votes
2 answers

Restricting Android NumberPicker to Numeric Keyboard for Numeric Input (not Alpha keyboard)

Is there a way to suggest or restrict keyboard input when selecting a NumberPicker so only the number controls are shown when entering values, similar to how you can use android:inputType="number" with a EditText? I have a series of values, from 0.0…
CrimsonX
  • 8,518
  • 8
  • 39
  • 52
6
votes
1 answer

Android NumberPicker OnValueChangeListener

I have a question concerning the Android NumberPicker. When the user is performing a Fling on a NumberPicker, for every single step the Listener for OnValueChange is triggered. Can I change this in that way, that the oldVal and the newVal can…
schorschel
  • 81
  • 1
  • 6
6
votes
1 answer

Implementing OnValueChange to a NumberPicker in Android

I"m trying to add the onValueChangeListener to my number picker (np1) in android 4.2.2. Here's what I have so far public class main extends Activity { ViewFlipper vf = null; HttpClient client = null; private ArrayList captionList = new…
TheMcMurder
  • 729
  • 3
  • 9
  • 20
5
votes
3 answers

Android Numberpicker decimals

I'm trying to create a numberpicker in Android but the wheel only increase by 1. I want to increase by 0.1. I've looked up on the net but I've found a formated array of floats disabling the wheel. Please help and sorry for the grammar, I'm learning.…
edusandovall
  • 73
  • 1
  • 7
5
votes
0 answers

Android numberpicker edge scrolling glitch

I've created a number picker with some string values. public void setValues() { boolean defaultAvaliable = false; int defaultRow = 0; String[] values = new String[pickValues.size()]; for (int i = 0; i < pickValues.size(); i++) { …
schmru
  • 501
  • 1
  • 9
  • 23
5
votes
1 answer

Texts in NumberPicker are cut off

I have dialog with NumberPicker security questions. The long texts are cut off. How to solve this issue? This is layout's content for dialog
hhs
  • 676
  • 1
  • 6
  • 20
5
votes
0 answers

Change the fling speed for Android's Numberpicker within an Alertdialog

I am using Androids Numberpicker within an alert dialog. However, as the list of values within the numberpicker is large e.g. 0-89 degrees say, I would like the fling gesture to scroll faster through the list of values as currently it is too slow.…
puzii
  • 97
  • 7
5
votes
2 answers

Set the number of visible items in a NumberPicker

I have a simple NumberPicker just like this: and I was wondering how I can make it show more elements above and below the selected element. For example, in the picture you can see "9" above the selected element "10", and "11" right below it. I…
Mike Laren
  • 7,388
  • 17
  • 46
  • 67
5
votes
3 answers

How to reduce the font size in NumberPicker

All, I'm customizing a city picker, which uses three numberPicker inside,like this: Its a Chinese province-city-area picker. The code: String[] areas = get_from_somewhere(); areaPicker.setDisplayedValues(areas); I want to reduce the font size,any…
Ninja
  • 2,289
  • 3
  • 18
  • 32
5
votes
5 answers

How to reset data of NumberPicker

I am using two NumberPickers to display province(mProvincePicker) and city(mCityPicker) data in my app. When user changes province data, city data should be changed accordingly. I reset the mCityPicker data in NumberPicker.onValueChange(NumberPicker…
iStar
  • 954
  • 9
  • 20
5
votes
1 answer

How to get the selected number from NumberPicker?

I have two number pickers, I want to get the value that user chose from thos number pickers. then convert them to String. Any idea?
user2977338
  • 125
  • 2
  • 5
  • 11
1 2
3
23 24