How to add progressbar (circle) and horizontal progress bar in the same activity in Android
Hi I need to do something like this :
I know,it's from an iphone application,but I want to add progressbar (circle) at the center of page and horizontal progressbar at the bottom of the page,which will show the current downloaded bytes and the speed of the internet connection.
I'm using this code for creating the circle progressbar :
private void createCancelProgressDialog(String title, String message, String buttonText)
{
cancelDialog = new ProgressDialog(this);
cancelDialog.setTitle(title);
cancelDialog.setMessage(message);
cancelDialog.setButton(buttonText, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
finish();
}
});
cancelDialog.show();
}
Any idea how to add the second horizontal progressbar? I tried to include it in createCancelProgressDialog but it didn't w开发者_StackOverflowork.
Thanks in advance!
You need to create a custom layout for your ProgressDialog and do your calculations in Runnable or using AsyncTask for example. Here is an example how you can do it : custom dialog.
Your circle progress bar his showing up in a dialog. Are you trying to put two progress bars in the same dialog? Or you want two dialog for each progress bar?
精彩评论