According to the documentation, NumberPicker (and all of its methods) are only available from API level 11 (SDK 3.0). Therefore, if you need compatibility with 2.3.x, you need to have your own implementation. Fortunately, here already exists here
Edit
The Internet was not very affectionate at the link above, and it is no longer available. Even the alternatives suggested in the comments have also disappeared. You better write your own.
Rajesh
source share