Reputation: 4919
I want to display some text from server, but till then I want to display Progress Bar.
Can anyone help me out. Response is in the form of JSON
Upvotes: 2
Views: 1797
Reputation: 16991
I've used AsyncTask to do this before. Make the progress dialog display in onPreExecute, and dismiss it in onPostExecute. Works very nicely, and it's nice and clean.
http://javatech.org/2011/02/discovering-android-opening-a-progress-dialog-with-asynctask/
Upvotes: 1
Reputation: 12662
how about this?
http://www.firstdroid.com/2010/08/04/adding-progress-bar-on-webview-android-tutorials/
final ProgressDialog pd = ProgressDialog.show(this, "", "Please Wait",
true);
final WebView engine = (WebView) findViewById(R.id.webview);
engine.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
if (pd.isShowing() && pd != null) {
pd.dismiss();
}
}
});
engine.loadUrl("http://www.domain.com/");
Upvotes: 4