Android implementation loading Prompt "is loading, please later" Method _android

Source: Internet
Author: User

Objective

This article is mainly about how to implement the Click button, pop-up "Loading data, please wait ..." dialog box, after loading, the dialog will automatically disappear?

In fact, it is also very simple to look at the following code:

 import COM.FARSUNSET.ICHAT.EXAMPLE.R;
Import Android.os.Bundle;
Import android.app.Activity;

Import Android.app.ProgressDialog;


 public class Datereportactivity extends activity {private ProgressDialog progressdialog;
  @Override protected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);

  Setcontentview (R.layout.activity_date_report);
 Showprogressdialog ("Prompt", "Loading ..."); /* Prompt to load/public void Showprogressdialog (string title, String message) {if (ProgressDialog = = null) {p
  Rogressdialog = Progressdialog.show (datereportactivity.this, title, message, True, false);
   else if (progressdialog.isshowing ()) {Progressdialog.settitle (title);
  Progressdialog.setmessage (message);

 } progressdialog.show (); * * * Hide prompt to load/public void Hideprogressdialog () {if (ProgressDialog!= null && progressdialog.isshowi
  Ng ()) {Progressdialog.dismiss (); }

 }

}

Summarize

OK, the above method can be used to implement the Android load Prompt "is loading, please later", the above is the entire content of this article, as for the XML file to write what is not to control, as long as you do project when using the networking program, you can use the above two methods. Hope that the content of this article for everyone's study or work can bring certain help, if there is doubt you can message exchange.

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.