I want to implement progressBar like on the picture below.
Right now, I have AsyncTask whic is sperated from fragments classes, and I use that AsyncTask to load data, and right now I have implement progressBar dialog, but I want to get rid of that, because I want make a better UX.
I show that ProgressBar dialog in onPreExecute() method, and then dismiss it onPostExecute.
So, how I can implement background Progress bar like on the picture below
With the same asynctask using publishProgress()
If you just want to show progress, take a look at this code. This might give you an idea: public class MainActivity extends Activity implements OnClickListener {
}
But if you want to show like a dialog, take a look at this code:
public class YoutubeVideoMain extends Activity {
}
Maybe this can help you.
Dude,
If you really just want a progress bar like the picture you posted, you can simply set the progress bar indeterminate property to true :)
You can eighter do on code or directly on the xml.
In code:
In your XML, just set the attribute indeterminate to true.
Here's is a simple layout as an example: