Best way to show a loading/progress indicator?

ProgressDialog is deprecated from Android Oreo. Use ProgressBar instead

ProgressDialog progress = new ProgressDialog(this);
progress.setMessage("Wait while loading...");
progress.setCancelable(false); // disable dismiss by tapping outside of the dialog;
// To dismiss the dialog

OR, "Loading", "Wait while loading...");

Read more here.

By the way, Spinner has a different meaning in Android. (It’s like the select dropdown in HTML)

Leave a Comment