如何在Google日历中取消选择特定日期。点击按钮我打开日期选择器对话框以选择日期。我需要,用户只能选择星期日。剩余的日子应该是透明的颜色无法选择。我怎么能这样做。
我试过的代码:
{
Calendar c = Calendar.getInstance();
int day = c.get(Calendar.DAY_OF_WEEK);
if (day !=Calendar.SUNDAY) {
c.add(Calendar.DAY_OF_WEEK,day);
}
dialog = new DatePickerDialog(this, datePickerListener, year,
month, day);
dialog.getDatePicker().setMinDate(System.currentTimeMillis() +
(1000 * 60 * 60 * 24));
dialog.show();
}
public DatePickerDialog.OnDateSetListener datePickerListener = new
DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int selectedYear,
int selectedMonth, int selectedDay) {
year = selectedYear;
month = selectedMonth;
day = selectedDay;
TextView tv = (TextView) v1.findViewById(R.id.txtDate);
tv.setText(new StringBuilder().append(day).append("-")
.append((month + 1)).append("-").append(year)
.append(" "));
}
};