Android Open Source - whohasmystuff Date Picker Fragment

From Project

Back to project page whohasmystuff.


The source code is released under:

GNU General Public License

If you think the Android project whohasmystuff listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.freewarepoint.whohasmystuff;
//from  w w  w. j a v a 2  s. c o  m
import android.os.Bundle;
import android.widget.DatePicker;

public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {

    private int year;
    private int month;
    private int day;

    public void setArguments(Bundle args) {
        year = args.getInt("year");
        month = args.getInt("month");
        day = args.getInt("day");

    public Dialog onCreateDialog(Bundle savedInstanceState) {
        return new DatePickerDialog(getActivity(), this, year, month, day);

    public void onDateSet(DatePicker view, int year, int month, int day) {
        if (getTag().equals("fragment_pick_date")) {
            ((AddObject)getActivity()).updateDate(year, month, day);
        else if (getTag().equals("fragment_pick_return_date")) {
            ((AddObject)getActivity()).updateReturnDate(year, month, day);


Java Source Code List