title: AsyncTask not calling doInBackground
body: <p>I have a button in my application which on click should run AsyncTask but the doInBackground method is not being called, I am trying to connect to my server using okHTTP inside AsyncTask, here is my code,</p>
  
  <pre><code>public class Home extends Fragment implements View.OnClickListener {
  Button button;
  public static final String TAG = "aj";
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View v = inflater.inflate(R.layout.home, container, false);
      button = (Button) v.findViewById(R.id.button);
      button.setOnClickListener(this);
      FirebaseMessaging.getInstance().subscribeToTopic("test");
      FirebaseInstanceId.getInstance().getToken();
      return v;
  }
  
  @Override
  public void onClick(View v) {
      sendRequest myTask = new sendRequest();
      if (Build.VERSION.SDK_INT&gt;= Build.VERSION_CODES.HONEYCOMB)
          myTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      else
          myTask.execute();
  }
  
  private class sendRequest extends AsyncTask&lt;Void,Void,Void&gt;{
      @Override
      protected Void doInBackground(Void... params) {
          Log.v(TAG, "doInBackground");
          String token = FirebaseInstanceId.getInstance().getToken();
  
          OkHttpClient client = new OkHttpClient();
          RequestBody body = null;
          if (token != null) {
              body = new FormBody.Builder()
                      .add("Token", token)
                      .build();
          }
          Request request = new Request.Builder()
                  .url("https://www.example.com/aj20010319")
                  .post(body)
                  .build();
          try {
              client.newCall(request).execute();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return null;
      }
  }
  }
  </code></pre>
  
  <p>I don't know why the doInBackground method is not being called, the logger doesn't log anything regarding it. And if I am correct, it is setup correctly. I tried the solutions in other threads but none is working.</p>