how to use number picker with dialog

I have made a small demo of NumberPicker. This may not be perfect but you can use and modify the same. Use a custom dialog and set the number picker. More info @ http://developer.android.com/reference/android/widget/NumberPicker.html public class MainActivity extends Activity implements NumberPicker.OnValueChangeListener { private TextView tv; static Dialog d ; @Override public void onCreate(Bundle savedInstanceState) { … Read more

How to create a number picker dialog?

I have made a small demo of NumberPicker. This may not be perfect but you can use and modify the same. public class MainActivity extends Activity implements NumberPicker.OnValueChangeListener { private static TextView tv; static Dialog d ; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv = (TextView) findViewById(R.id.textView1); Button b = (Button) findViewById(R.id.button11); b.setOnClickListener(new … Read more

Change the text color of NumberPicker

The solution I tried and worked for me is: In styles.xml add: <style name=”AppTheme.Picker” parent=”Theme.AppCompat.Light.NoActionBar” > <item name=”android:textColorPrimary”>@android:color/black</item> </style> Then use it like this inside your layout: <NumberPicker android:id=”@+id/dialogPicker” android:theme=”@style/AppTheme.Picker” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_marginTop=”15dp” />