Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android numberpicker set value seen on open

I am looking to set the numberpicker a default value when I click on it. Now it shows "0". I want to pick the number you see as first in the numberpicker. I am working with integers.

It should be very easy, but I can't find it. This needs to be done programmatically.

Many thanks,

like image 362
Martijn Jan Jaap de Bruin Avatar asked Nov 04 '15 15:11

Martijn Jan Jaap de Bruin


1 Answers

You should call setValue() on the NumberPicker instance, if you wish to use a default value:

numberPicker.setValue(5); // example value
like image 69
fractalwrench Avatar answered Oct 11 '22 15:10

fractalwrench