开发者

How to call a Date picker dialog inside the Dialog's button

I have created an Activity which has a dialog, this dialog has an EditText fiel开发者_StackOverflowd with Button. Now, on button click I have to show a Date Picker. How can I do this?


 public void onClick(View v) {
                AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext());
                builder.setMessage("Are you sure? Continue will exit the app")
                        .setCancelable(false)
                        .setPositiveButton("Continue & exit",
                                new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                       // Add your data picker code here.
                                    }
                                })
                        .setNegativeButton("Return", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int id) {
                                dialog.cancel();
                            }
                        });
                AlertDialog alert = builder.create();
                alert.show();
            }
        });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜