Here's my code for showing ProgressDialog:

```
ProgressDialog pd = new ProgressDialog(MainActivity.this);
pd.setTitle("");
pd.setMessage("Sending...");
pd.show();

```

I want to dismiss the ProgressDialog in another method but when I put
 pd.dismiss();
there will be an error with pd.

> 
> pd cannot be resolved.
> 
> 
> 

Any way to make it possible? Thankyou.