Two date pickers in same activity android -


I have an activity where I need to accept the two dates, a start date and end date. I have two buttons on which the date picker will be clicked, after entering the date, I need to store this date using the shared references. I am using this tutorial:

I'm not using any Daylogfragment have seen question picker two dates but these. They are using dislikes, and I really do not want to use them because I have heard that it is better to use DialogFragment.

How can I now know about two date pickers? How do I know which button was clicked in the onDateSet function (startbutton or endbutton)? Is there a way to store view IDs in the Dialog fragment on the button click, so that I can access it on the dataset?

Any help would be great, thanks.

may be such that:

  View. OnClickListener showDatePicker = new View.OnClickListener () {@ Override on public void (see V) {last see vv = v; DatePickerDialog datePickerDialog = new DatePickerDialog (getActivity (), New DatePickerDialog.OnDateSetListener () {@Override public void Prdetset (Tithikar Show, Int year, int monthOfYear, int dayOfMonth) {if (vv.getId () == Araidikstartdet // ID of your StartDate button) {// do stuff} and // click on the end date button {// stuff do}}}, year, month, day); DatePickerDialog.show (); }}; StartDate.setOnClickListener (showDatePicker); EndDate.setOnClickListener (showDatePicker);  

The main idea here view has been removed OnClickEvent (ID of the scene with the buttons on your case) and ID Compare your button to


Comments