I have created a ProgressDialog in my android application. But the problem I am having is during the point where it is actually doing the work it stops spinning the wheel. Here is my code. How can I make it so it continually spins the wheel while my other work is going on?
button5.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
System.out.println("Button5");
//Handler to make the please wait message
final ProgressDialog myProgressDialog = ProgressDialog.show(
FoodSubstitutesActivity.this, "Please wait...",
"Getting most recent updates...", true);
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
//DO STUFF - STOPS SPINNING WHEEL UNTIL THIS PART IS COMPLETE.
myProgressDialog.dismiss();
}
}, 500);
}
});
Why dont you try doing it this way?
taken from: http://www.tutorials-android.com/learn/How_to_display_a_progress_dialog_while_computing.rhtml