android - Issue setting AlertDialog -


i trying display alertdialog, compile error of (ambiguous) on following line:

alertdialog.setbutton(dialoginterface.button_positive, "ok", null); 

how should set button?

            alertdialog.builder dlgalert  = new alertdialog.builder(this);         dlgalert.setmessage(getresources().getstring(r.string.err_connection));         dlgalert.settitle(getresources().getstring(r.string.err_connection_header));         dlgalert.setpositivebutton(getresources().getstring(r.string.ok),             new dialoginterface.onclicklistener() {                 public void onclick(final dialoginterface dialog, final int which) {                     finish();                 }             });         dlgalert.setcancelable(true);         dlgalert.create().show(); 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -