android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application

When I tried to show progress dialog when content is loading through http channel. It gave this error:
android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application
I was using like this:

Context mContext;
    ProgressDialog pDialog;

    public AuthTask(Context context) {
        mContext = context;
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        // Showing progress dialog
        pDialog = new ProgressDialog(mContext);
        pDialog.setMessage(mContext.getString(R.string.authorization));
        pDialog.setCancelable(false);
        pDialog.show();
    }

Solution: On Activity, where I am starting this task, I have created public static instance of this activity

    public static Activity activity;
...
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign_in);

        context = getApplicationContext();
        activity = SignInActivity.this;

Instead of mContext, I used copy of that activity – SignInActivity.activity

Context mContext;
    ProgressDialog pDialog;

    public AuthTask(Context context) {
        mContext = context;
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        // Showing progress dialog
        pDialog = new ProgressDialog(SignInActivity.activity);
        pDialog.setMessage(mContext.getString(R.string.authorization));
        pDialog.setCancelable(false);
        pDialog.show();
    }