android3.0里新添的控件,如果不用3.0,就用下面的源码,google写的。
代码太长,见附件。
用法,仅供参考:
public class Screen0 extends Activity implements SetPickerDialogListener{ private static final String tag="Screen0"; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.screen_0); NumberPicker numpicker=(NumberPicker)findViewById(R.id.numpicker); numpicker.setPDListener = this; } @Override public void onPickerChangeListener() { // TODO Auto-generated method stub Log.d(tag, "-----------------onPickerChangeListener---------------------"); } }