How to show progress dialog in Android?

user1285707 picture user1285707 · May 4, 2012 · Viewed 214.9k times · Source

I want to show ProgressDialog when I click on Login button and it takes time to move to another page. How can I do this?

Answer

Jave picture Jave · May 4, 2012
ProgressDialog pd = new ProgressDialog(yourActivity.this);
pd.setMessage("loading");
pd.show();

And that's all you need.