Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - How to show a "are u sure YES OR NOT" dialog when user press a button? -


first of all, have tell have searched here , on google , can't find easy way (im newbie on this), need please

i have button, removes friend remote database:

removebutton.setonclicklistener(new onclicklistener() {             public void onclick(view v) {                 con.deletepermission(settings.getstring("login",""),bundle.getstring("email"));                 finish();                 toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show();             }         });  

i want show simple "are sure? yes or not" dialog 2 buttons (yes , not) , when user press yes, have called code:

con.deletepermission(settings.getstring("login",""),bundle.getstring("email"));                     finish();                     toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show(); 

exist's easy way it?

thanks

edit: try this: http://developer.android.com/guide/topics/ui/dialogs.html doesn't works, nothing happens when press button, no dialog appear

my new code:

bundle = this.getintent().getextras();//get intent & bundle passed x         builder = new alertdialog.builder(this);         removebutton.setonclicklistener(new onclicklistener() {             public void onclick(view v) {                 /*                 con.deletepermission(settings.getstring("login",""),bundle.getstring("email"));                 finish();                 toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show();                 */                 builder.setmessage("are sure?")                        .setcancelable(false)                        .setpositivebutton("yes", new dialoginterface.onclicklistener() {                            public void onclick(dialoginterface dialog, int id) {                                 con.deletepermission(settings.getstring("login",""),bundle.getstring("email"));                                 finish();                                 toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show();                            }                        })                        .setnegativebutton("no", new dialoginterface.onclicklistener() {                            public void onclick(dialoginterface dialog, int id) {                                 dialog.cancel();                            }                        });                 alertdialog alert = builder.create();             }         });  

from documentation:

creates alertdialog arguments supplied builder. not show() dialog. allows user processing before displaying dialog. use show() if don't have other processing , want created , displayed.

that means, need call show().


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -