Sometimes it is necessary to pop up a dialog box, the most concise code summarized below. Make a record easy to copy and paste later.
If there is a simpler way, continue with the update. Fewer code, fewer bugs.
Business for Popup A dialog box lets the user confirm the assignment of the customer to the sales consultant
New Alertdialog.builder (this).
Settitle ("Assign reminders").
SetIcon (Android. R.drawable.ic_dialog_info).
Setmessage ("OK to put the customer" + getString ("CNAME") + "Assign to Advisor" + list.get (position). Getnickname () + "?").
Setpositivebutton ("OK", new Dialoginterface.onclicklistener () {
@Override
public void OnClick (Dialoginterface dialog, int which) {
Staticmethod.showloading (this);
Data. Xsjl_fpkh (List.get (position). getau_id (),
GetUserInfo (). Geta_areaid (),
GetString ("CID"),
List.get (position). Getnickname (), 0, New Ihttpresponse () {
@Override
public void Onsucc (Object response) {
Staticmethod.closeloading ();
Activityfinish ();
}
@Override
public void Onfail (String response) {
ShowMsg (response);
}
});
}
}).
Setnegativebutton ("Cancel", new Dialoginterface.onclicklistener () {
@Override
public void OnClick (Dialoginterface dialog, int which) {
Dialog.cancle ();
}
}). Show ();
Android Minimalist dialog pop-up tips