This article describes the Android programming method to load and wait for ProgressDialog. Share it for your reference, as follows:
The class that displays progressDialog:
import ; import ; import ; import ; public class ShowProgressDialog { public static ProgressDialog wait; public static void show(Context context,String msg,Thread thread) { final Thread th = thread; wait = new ProgressDialog(context); //Set the style to circle (ProgressDialog.STYLE_SPINNER); (null); (null); //Set prompt information (msg); //Set whether it can be cancelled by the return key (true); (false); //Set cancel listening (new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { (); } }); (); } }
When calling, the progressDialog is displayed as the main thread, and the thread starts to perform business processing. Wait until the business processing is completed and the progressDialog is closed. If you need to prompt information after processing, it is not possible to directly enter the business thread. You need to use the Handler to realize the interaction between thread and activity.
I hope this article will be helpful to everyone's Android programming design.