我是android的新手.我使用以下指南在android中创建了一个日期选择器.http://developer.android.com/guide/topics/ui/controls/pickers.html
public class DatePickerFragment extends DialogFragment
implements DatePickerDialog.OnDateSetListener {
StringBuilder sb = new StringBuilder();
public static String date;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}
public void onDateSet(DatePicker view, int year, int month, …Run Code Online (Sandbox Code Playgroud)