Asked By
anonymous
7060 points
N/A
Posted on - 02/13/2013
Hi programmers,
I am developing an Android app for smart phone. I need some help from Android developers. I wish to display  progress circle icons when my apps are busy or uploading some information. May I need to create animation or  Xml file for it? Can someone provide me the edit able code for this purpose?  Please share your ideas and tips.
Thanks
I need progress circle icons for android apps
Â
Hello,
Â
Â
Rather than using XML, I would suggest using Java code because, suitable to your problem, there are plenty of examples that make use of the AsynchTask class.Â
Â
Here is the generic for that class: AsyncTask<Void,Vois,Void>
Â
You could override a method named "onPostExecute" such that it could stop the spinner. Below is an example code of that method.
Â
protected void onPostExecute(Void result) { Â Â Â Â Â
  super.onPostExecute(result);
progDialog.dismiss();
  //perform action as per response
Â
    if(respose.equals("success")){
     //message describing success
Â
    }else if(response.equals("failure"))
Â
     //message describing failure
    }else {
Â
     // display connectivity error
    }
   }
  };
Â
Also, you need to override the onPreExecute and doInBackground methods.
Â
progDialog is an instance of ProgressDiaglog which must be initialized within onPreExecute.Â
Â
Â
Best Regards,
Parisi