private class performBackgroundTask extends AsyncTask < Void, Void, Void >
{
private ProgressDialog pdia;
@Override
protected void onPreExecute(){
super.onPreExecute();
pdia = new ProgressDialog(FriendList.this);
pdia.setMessage("Loading...");
pdia.show();
}
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
asybcTastRun = new AsyncFacebookRunner(LoginActivity.facebook);
asybcTastRun.request("me/friends", new FriendCallback());
return null;
}
protected void onPostExecute(String result){
// super.onPostExecute(result);
pdia.dismiss();
}
}
{
private ProgressDialog pdia;
@Override
protected void onPreExecute(){
super.onPreExecute();
pdia = new ProgressDialog(FriendList.this);
pdia.setMessage("Loading...");
pdia.show();
}
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
asybcTastRun = new AsyncFacebookRunner(LoginActivity.facebook);
asybcTastRun.request("me/friends", new FriendCallback());
return null;
}
protected void onPostExecute(String result){
// super.onPostExecute(result);
pdia.dismiss();
}
}
Very useful example.Thanks
ReplyDeletehere is another useful example that lets you use ProgressDialog using threads and handlers also . http://blog.creatiosoft.com/?p=1316
Thanks meera..:)
Deletevk
Simple but effective example, But in this way, the progress dialog spinner is not animating. why?
ReplyDeletevery nice tutorial you can also check this onehttp://pavanhd.blogspot.in/2013/04/android-progress-dialog-example.html>
ReplyDelete