Android Open Source - whohasmystuff Date Picker Fragment






From Project

Back to project page whohasmystuff.

License

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.app.DatePickerDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.widget.DatePicker;

public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {

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

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

    @Override
    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

de.freewarepoint.whohasmystuff.AbstractListFragment.java
de.freewarepoint.whohasmystuff.AddObject.java
de.freewarepoint.whohasmystuff.DatePickerFragment.java
de.freewarepoint.whohasmystuff.LentObject.java
de.freewarepoint.whohasmystuff.ListLentObjects.java
de.freewarepoint.whohasmystuff.MainActivity.java
de.freewarepoint.whohasmystuff.ShowHistory.java
de.freewarepoint.whohasmystuff.database.DatabaseHelper.java
de.freewarepoint.whohasmystuff.database.OpenLendDbAdapter.java
de.freewarepoint.whohasmystuff.database.XMLContentHandler.java