Bu konuda yapabileceğiniz en kolay yol, default Android NumberPicker kullanmaktır.
LayoutInflater inflater = (LayoutInflater)
getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View npView = inflater.inflate(R.layout.number_picker_dialog_layout, null);
return new AlertDialog.Builder(this)
.setTitle("Text Size:")
.setView(npView)
.setPositiveButton(R.string.dialog_ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
})
.setNegativeButton(R.string.dialog_cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
})
.create();
Bu güzel ve güzel bir soruydu, neden kapattıklarını bilmiyorum. Her neyse, işte bulduğum en iyi çözüm: http://www.lukehorvat.com/blog/android-numberpickerdialogpreference/ – dazito