{"id":6732,"date":"2014-04-22T12:42:07","date_gmt":"2014-04-22T12:42:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/22\/problem-about-datepickerdialog-collection-of-common-programming-errors\/"},"modified":"2014-04-22T12:42:07","modified_gmt":"2014-04-22T12:42:07","slug":"problem-about-datepickerdialog-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/22\/problem-about-datepickerdialog-collection-of-common-programming-errors\/","title":{"rendered":"problem about datepickerdialog-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cd165c786a71b9941f741b8bda7fbc08?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2991491<br \/>\nandroid dialog fragment android-datepicker datepickerdialog<br \/>\nI use to show the better picker date dialog in button click event.I have problem while changing the orientation. now all I wanna do is to close this better picker dialog as below line@Overridepublic void onConfigurationChanged(Configuration newConfig) {getFragmentManager().findFragmentByTag(&#8220;better_date_picker&#8221;).getParentFragment().getActivity().finish();super.onConfigurationChanged(newConfig);}The problem is my app getting crashed while changing the orientation, as It cannot find better_date_p<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2cfa65e797a3b2ba922ec4387529b79d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAnton Safonov<br \/>\nandroid alertdialog datepickerdialog<br \/>\nAll Hi!If I show DatePickerDialog and click button negative, next I want show AlertDialog but he crashed. If I show DatePickerDialog and click button_positive &#8211; then all is well (AlertDialog can show).protected Dialog onCreateDialog(int id) {if (id == DIALOG_DATE) {final DatePickerDialog tpd = new DatePickerDialog(this, myCallBack, 2000, 02, 02);tpd.setOnShowListener(new DialogInterface.OnShowListener() {public void onShow(final DialogInterface dialog) {Button d = tpd.getButton(DatePickerDialog.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/de10775fcf8f626d757dbeed89c0beb0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEmiliano Magnani<br \/>\nandroid crash version datepickerdialog<br \/>\nI have a DatePickerDialog on my application. I am using DatePickerDialog because I need to show only month and year and it&#8217;s easier with dialog than datepicker.Its working fine in 4.0 or higher version but when I try to open the DatePickerDialog clicking an edittext in 2.3 the app get crashed.Here the code:import java.lang.reflect.Field; import java.util.Date;import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.O<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/37c5c27b56ef7b3b2c4056f54ac6c366?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nA&#8211;C<br \/>\nandroid crashing datepickerdialog<br \/>\nI am using DatePickerDialog to set the date, but my app is crashing when I use this DatePicker .. Means the app doesn&#8217;t crash when I don&#8217;t use it and just submit the data &#8230; Here&#8217;s the code of DatePickerDialog:public static class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {@Overridepublic Dialog onCreateDialog(Bundle savedInstanceState) {\/\/ Use the current date as the default date in the pickerfinal Calendar c = Calendar.getInstance();int year = c.ge<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>user2991491 android dialog fragment android-datepicker datepickerdialog I use to show the better picker date dialog in button click event.I have problem while changing the orientation. now all I wanna do is to close this better picker dialog as below line@Overridepublic void onConfigurationChanged(Configuration newConfig) {getFragmentManager().findFragmentByTag(&#8220;better_date_picker&#8221;).getParentFragment().getActivity().finish();super.onConfigurationChanged(newConfig);}The problem is my app getting crashed while changing the orientation, as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6732","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6732"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6732\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}