I saw the date today. Select Open Source project:https://github.com/roomorama/Caldroid
:
Open source projects are developed using studio, and if you use Eclipse to manually import it, you can do it in a common way:
public static SimpleDateFormat formatter = new SimpleDateFormat ("dd MMM yyyy");
button Showdialogbutton = (Button) Findviewbyid (R.id.show_dialog_button); Showdialogbutton.setonclicklistener (New Onclicklistener () {@Overridepublic void OnClick (View v) {//Setup caldroid to Use as Dialogdialogcaldroidfragment = new Caldroidfragment ();d Ialogcaldroidfragment.setcaldroidlistener (GetListener ()); Bundle state = savedinstancestate;final String Dialogtag = "Caldroid_dialog_fragment", if (state! = null) {DIALOGCALDROIDF Ragment.restoredialogstatesfromkey (Getsupportfragmentmanager (), state, "Dialog_caldroid_saved_state", DialogTag); Bundle args = Dialogcaldroidfragment.getarguments (); if (args = = null) {args = new Bundle (); Dialogcaldroidfragment.setarguments (args);}} else {//setup Argumentsbundle bundle = new Bundle ();//Setup dialogtitledialogcaldroidfragment.setarguments (bundle);} Dialogcaldroidfragment.show (Getsupportfragmentmanager (), "caldroid_dialog_fragment");});
Protected Caldroidlistener Getlistener () {//TODO auto-generated method stub return new Caldroidlistener () { @Ov Erride public void onselectdate (date date, view view) { //TODO auto-generated method stub Dialogcaldroidfragment.dismiss (); Toast.maketext (Getapplicationcontext (), Formatter.format (date), Toast.length_short). Show ();};
It is very useful!! The project uses a third-party jar:date4j if the eclipse integration needs to be downloaded by itself
Android Date Selector