Android Minimalist dialog pop-up tips

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.