Praveen
Praveen

Reputation: 91175

ProgressBar between to activities in android?

when click the grid item, i want to show a progressbar between the time of next Activity shown. then the second activity has a custom listview. there also i want to show a progressbar. how to do that?

Upvotes: 1

Views: 1683

Answers (2)

user644458
user644458

Reputation:

You should try this,

First Create the ProgressDilog in Activity. . .

private ProgressDialog progressDialog;

Now, Set the ProgressDialog in the Any action where u want to Take Some time

progressDialog = ProgressDialog.show(FoodDriveModule.this, "", "Loading...");

Now use Thread to Handle the Progressbar

new Thread() 
   {
    public void run() 
    {
    try
    {
     sleep(1500);
// Now Do some Task whatever u want to do
   } 
   catch(Exception e)
   {
     Log.e("tag",e.getMessage());
   }
}.start();

Thats it. Hope this will help you.

Upvotes: 0

DrBloodmoney
DrBloodmoney

Reputation: 2796

I'm just learning myself and I haven't had a chance to inspect the source, but I know that the RedditIsFun app (for Reddit, of course) does this in-between loading the next links, and loading comments. Check out the source.

Upvotes: 1

Related Questions