I'm implementing an app that uses many methods that requires an `AsyncTask` with a waiting dialog.
Actually my approach is to use every time an inner class that extends AsyncTask

something like

```
 private class AsyncOperation extends AsyncTask<Void, Void, Void> {

        @Override
        protected void onPreExecute(){
            pDialog = new ProgressDialog(CurrencyConverterActivity.this);
            pDialog.setMessage("Waiting...");
            pDialog.show();
        }
        @Override
        protected Void doInBackground(Void... params) {
           ...
          return null
         }

        protected void onPostExecute(Void params){
            pDialog.dismiss();
            runOnUiThread(new Runnable() {
                public void run() {
                    //dialogs according status the                     
                    //int status is a static variable declared in external class
                }

            });

        }

```

since with this approach i have to write this inner class too many times and this result in dirty code not well readable, I'm looking for a smarter solution 

Could someone help me?