开发者

How to achieve Local Notification in android 2.3.1?

开发者 https://www.devze.com 2023-02-17 11:57 出处:网络
any one know how to achieve local notification in and开发者_StackOverflow社区roid.currently i am working on Android2.3.1please help to achieve it....

any one know how to achieve local notification in and开发者_StackOverflow社区roid.currently i am working on Android2.3.1 please help to achieve it....

Thanks in Advance---


I seems from your comment that you are looking for a Dialog not a notification. This code will give you a dialog with a yes and no button.

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage("Put your question here?")
    .setCancelable(false)
    .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // put your code here
        }
    })
    .setNegativeButton("No", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // put your code here 
            dialog.cancel();
        }
    });
    AlertDialog alertDialog = builder.create();
    alertDialog.show();
0

精彩评论

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

关注公众号