Hide particular day from google calendar in Android -
how can make particular day deselected in google calendar.on click of button open date picker dialog select date.here need, user can able select sunday. remaining days should unselectable transparent color. how can this.
code tried:
{ 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(" ")); } };
Comments
Post a Comment