I have a datepicker. My app is pushing a notification. I want to display the date in 01-07-2013 MM-dd-yyyy format. Please check my code below:
//---Button v
just use this code..
date.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
DatePickerDialog dateDlg = new DatePickerDialog(New_Quote_Activity.this, new DatePickerDialog.OnDateSetListener()
{
public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth)
{
CharSequence strDate = null;
Time chosenDate = new Time();
chosenDate.set(dayOfMonth, monthOfYear, year);
long dtDob = chosenDate.toMillis(true);
strDate = DateFormat.format("MM/dd/yyyy", dtDob);
txtDate.setText(strDate);
}}, year,month,day);
dateDlg.show();
}
});