title: Override onPostExecute() in AsyncTask
body: <p>I can't seem to figure this out. As far as I know, I have followed the guidelines for extending the AsyncTask class, and all other related questions on SO are not helpful in my case.</p>
  
  <p>here is my class that extends AsyncTask:</p>
  
  <pre><code>package com.ck.nisttime;
  
  import android.content.Context;
  import android.os.AsyncTask;
  import android.util.Log;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.net.Socket;
  import java.net.UnknownHostException;
  
  /**
   * Created by ck on 12/15/15.
   */
  public class FetchTime extends AsyncTask&lt;Void,Void,String&gt; {
      private int port=13;
      private String host="time-b.nist.gov";
      private MainActivity mainAct;
  
      public FetchTime(Context context){
          this.mainAct=(MainActivity) context;
      }
  
      @Override
      protected String doInBackground(Void... params) {
          String time="";
          try {
              Socket socket=new Socket(host,port);
              BufferedReader in= new BufferedReader(new InputStreamReader(socket.getInputStream()));
              in.readLine();
              time=in.readLine();
              socket.close();
          } catch(UnknownHostException uhe){
              Log.e("ck", uhe.toString());
          }
          catch (IOException e) {
              e.printStackTrace();
          }
          return time;
      }
  
      @Override
      protected void onPostExecuted(String time){
          mainAct.showTime(time);
      }
  }
  </code></pre>
  
  <p>The error occurs when I attempt to override onPostExecute, stating 'Method does not override method from its superclass'. I think I could just make a class variable to store the string and just change it to <code>...extends AsyncTask&lt;Void,Void,Void&gt;...</code> but thats not how it should be done.</p>