android - Datepicker dialog call two times -
in application have used 1 datepicker dialog.which show date picker popup fine , selcted item displayed correctly.my problem in call event print date 2 times added in db 2 times when insert date.please 1 me please 1 me...
datepickerdialog:
new datepickerdialog(getactivity(),r.style.theme_customdialog,changedate,calendarfuture.get(calendar.year) ,calendarfuture.get(calendar.month),calendarfuture.get(calendar.day_of_month) ).show();
call event is:
datepickerdialog.ondatesetlistener changedate=new datepickerdialog.ondatesetlistener() { @override public void ondateset(datepicker view, int year, int monthofyear, int dayofmonth) { calendarfuture.set(calendar.year, year); calendarfuture.set(calendar.month, monthofyear); calendarfuture.set(calendar.day_of_month, dayofmonth); log.i(tag,"futurecalendar:"+android.text.format.dateformat.format("dd mm yyyy", calendarfuture)); }
output is:
futurecalendar:13 08 2013 futurecalendar:13 08 2013
you can try this
@override public void ondateset(datepicker view, int year, int monthofyear, int dayofmonth) { if(view.isshown()) log.i(datedialogfragment.class.getname(),year+"/"+monthofyear+"/"+dayofmonth); }
Comments
Post a Comment