我已经试过看这个问题的很多例子,并已经提出这个问题,但没有提交任何我曾经试过的代码。 我已经有了一个DatePicker,当用户点击EditText字段时popup eReminderDate.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //To show current date in the datepicker Calendar mcurrentDate = Calendar.getInstance(); int mYear = mcurrentDate.get(Calendar.YEAR); int mMonth = mcurrentDate.get(Calendar.MONTH); int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH); DatePickerDialog mDatePicker; mDatePicker = new DatePickerDialog(AddReminder.this, new OnDateSetListener() { public void onDateSet(DatePicker datepicker, int selectedyear, int […]
我的应用程序显示一个TimePickerDialog来设置一个时间。 我希望timePickerDialog以5分钟的间隔显示分钟。 这与这个代码工作正常: private final int TIME_PICKER_INTERVAL=5; private boolean mIgnoreEvent=false; … public TimePickerDialogs(Context arg0, OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView) { super(arg0, callBack, hourOfDay, minute, is24HourView); formato=Statics.formato; } @Override public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { //super.onTimeChanged(arg0, arg1, arg2); if (mIgnoreEvent) return; if (minute%TIME_PICKER_INTERVAL!=0){ int minuteFloor=minute-(minute%TIME_PICKER_INTERVAL); minute=minuteFloor + (minute==minuteFloor+1 ? TIME_PICKER_INTERVAL […]