How to make the datepicker in spin view. Here is the image,
I want the datepi
@Override
parentView.findViewById(R.id.changeDate).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DialogFragment newFragment = new SelectDateFragmentTrans();
newFragment.show(getFragmentManager(), "DatePicker");
}
});
SelectDateFragmentTrans.java:
public class SelectDateFragmentTrans extends DialogFragment
implements DatePickerDialog.OnDateSetListener {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Calendar calendar = Calendar.getInstance();
int yy = calendar.get(Calendar.YEAR);
int mm = calendar.get(Calendar.MONTH);
int dd = calendar.get(Calendar.DAY_OF_MONTH);
return new DatePickerDialog(getActivity(), this, yy, mm, dd);
}
public void onDateSet(DatePicker view, int yy, int mm, int dd) {
populateSetDate(yy, mm+1, dd);
}
public void populateSetDate(int year, int month, int day) {
SettingsFragment.date1 = month+"/"+day+"/"+year;
TransferFragment.date.setText(month+"/"+day+"/"+year);
}
}