int DIALOG_YES_NO_MESSAGE = 999;

 protected Dialog onCreateDialog(int id)
    {

        switch (id)
        {
         case DIALOG_YES_NO_MESSAGE:
            return new AlertDialog.Builder(Visited_channels.this)
                .setTitle("title")
                .setPositiveButton("OK", new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {

                        // User clicked OK so do some stuff
                     System.out.println("OK clicked.");
                    }
                })
                .setNegativeButton("Cancel", new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {

                        // User clicked Cancel so do some stuff

                     System.out.println("cancel clicked.");
                    }
                })
                .create();
        }
        return null;
        }


and call

showDialog(DIALOG_YES_NO_MESSAGE);


On Mon, Feb 23, 2009 at 11:56 AM, Bob <[email protected]> wrote:

>
> Hi,
> How do I display a simple yes/no or ok/cancel dialog with a title and
> react to the user choice?
>
> Thanks,
> Bob
> >
>


-- 
Dilli Rao. M
ARIJASOFT
+91 - 9703073540

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to