title: Android - on post execute in AsyncTask
body: <p>I currently have an <code>asyncTask</code> which on preexecute begins a loading bar, in background send something to a server, and on post execute dismisses the dialog and enables a button. However, my post execute is not executing due to doInBackground returning null. I'm trying to figure out what I can do do get the postExecute to run. any ideas? thanks</p>
  
  <p>code:</p>
  
  <pre><code>class DatabaseAsync extends AsyncTask&lt;Void,Void,Void&gt;{
          @Override
          protected void onPreExecute(){
              dialog = ProgressDialog.show(MainFeedActivity.this, null, "Posting...");
          }
  
          @Override
          protected Void doInBackground(Void... arg0) {
              Log.d(TAG, "send to databse");
              SendToDatabase();
              Log.d(TAG, "sent to database - DONE");
  
              //dialog.dismiss();
  
              //sendButton.setEnabled(true);
  
              return null;
          }
  
          protected void onPostExecute(){
              Log.d(TAG, "p execute");
              dialog.dismiss();
              sendButton.setEnabled(true);
              Log.d(TAG, "done executing");
          }
  
      }
  </code></pre>