I am using datePicker to input a date.
<style name="DatePickerTheme" parent="@android:style/Theme.Holo.Light.Dialog.MinWidth">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
</style>
and in Activity.java
public void showDatePickerDialog(View v) {
DialogFragment newFragment = new Login.DatePickerFragment();
newFragment.show(getSupportFragmentManager(), "datePicker");
}
public static class DatePickerFragment extends DialogFragment
implements DatePickerDialog.OnDateSetListener {
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new DatePickerDialog(getActivity(), R.style.DatePickerTheme, this, 1995, 0, 1);
}
public void onDateSet(DatePicker view, int year, int month, int day){
dateSelected = year+"-"+month+"-"+day;
}
}
Issue is that I am getting a background tile, which I dont want.
but I want
This line can help:
datePickerDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With