How to use a Spineer-wheel
I've a data to update from a remote server. I want the user to know that data is being downloaded while the user is interacting with the UI. I want the "updating..." information together with a spinner-wh开发者_StackOverflow社区eel (rotating circle or something) to be displayed at the bottom of the screen and disappear when the update is completed. Which control should i consider using? I already have AsyncTask. Any tutorial and example links are highly appreciated.
Class var
ProgressDialog dialog;
in your onPreExecute() call
dialog = ProgressDialog.show(MyActivity.this, "", "Loading. Please wait...", true);
and in onPostExecute()
dialog.dismiss();
If you make the dialog cancelable, be sure to implement onCancelled() on the AsyncTask and call the AsyncTask.cancel(true) if the user wants to cancel the Async process. Another implementation is the onCreateDialog(id) with calling methods showDialog(id), dismissDialog(id) and removeDialog(id)
Usually, I would just use an ImageView or an ImageButton if that's like a refresh button and rotate it using "startAnimation" method.
For this method, you can use any spinner wheel pngs.
精彩评论