title: Retrofit, TimeoutException
body: <p>I'm using retrofit authentication, and I have a timeoutexception. I saw many questions, but I can't solve this.</p>
  
  <p>Here's the code </p>
  
  <pre><code>public class FragmentRegistration extends Fragment {
  View mainView;
  
  EditText username, email, password, name;
  Button button;
  
  ApiClient pentairAPIClient = ApiClient.getInstance();
  
  SupportopObj supportopObj = new SupportopObj();
  SupportopObjActivate supportopObjActivate = new SupportopObjActivate();
  
  @Override
  public View onCreateView(LayoutInflater inflater,
                           @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      mainView = inflater.inflate
              (R.layout.registration, container, false);
  
      username = mainView.findViewById(R.id.username);
      email = mainView.findViewById(R.id.email);
      password = mainView.findViewById(R.id.password);
      name = mainView.findViewById(R.id.name);
      button = mainView.findViewById(R.id.register);
  
      button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              //String s = name.getText().toString();
              //String split[] = s.split(" ");
  
              supportopObj.setFirstName("Tester");
              supportopObj.setLastName("Testryan");
              supportopObj.setUsername(username.getText().toString());
              supportopObj.setEmail(email.getText().toString());
              supportopObj.setPassword(password.getText().toString());
  
              supportopObjActivate.setUsername(supportopObj.getUsername());
              supportopObjActivate.setEmail(supportopObj.getEmail());
              supportopObjActivate.setPassword(supportopObj.getPassword());
              supportopObjActivate.setType("generic");
              updateApp();               
          }
      });
  
      return mainView;
  }
  
  
  public void updateApp() {
  
      Call&lt;ResponseBody&gt; call = pentairAPIClient.registration(supportopObj);
      call.enqueue(new Callback&lt;ResponseBody&gt;() {
          @Override
          public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
              if (response.isSuccessful()) {
                  activationCall();
  
              } else {
                  Toast.makeText(getContext(), "Something went wrong",
                          Toast.LENGTH_SHORT).show();
              }
          }
  
          @Override
          public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
              Toast.makeText(getContext(), "Error...", Toast.LENGTH_SHORT).show();
          }
      });
  }
  
  
  public void activationCall() {
      Call&lt;ResponseBody&gt; callActive = pentairAPIClient.activation(supportopObjActivate);
      callActive.enqueue(new Callback&lt;ResponseBody&gt;() {
          @Override
          public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
  
              if (response.isSuccessful()) {
  
                  try {
                      String data = response.body().string();
                      JSONObject obj = new JSONObject(data);
                      String client_id = obj.getString("client_id");
                      String client_secret = obj.getString("client_secret");
  
                      tokenCall(client_id, client_secret);
  
                  } catch (JSONException | IOException e) {
                      e.printStackTrace();
                  }
  
              } else {
                  Toast.makeText(getContext(), "error", Toast.LENGTH_SHORT).show();
              }
          }
  
          @Override
          public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
              Toast.makeText(getContext(), "Error in activation",
                      Toast.LENGTH_SHORT).show();
          }
      });
  }
  
  
  public void tokenCall(String client_id, String client_secret) {
      Call&lt;ResponseBody&gt; token = pentairAPIClient.get_token("password", client_id, client_secret,
              supportopObj.getEmail(), supportopObj.getPassword());
  
      token.enqueue(new Callback&lt;ResponseBody&gt;() {
          @Override
          public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
              if (response.isSuccessful()) {
                  Toast.makeText(getContext(), String.valueOf(response.body()), Toast.LENGTH_SHORT).show();
              } else {
                  Toast.makeText(getContext(), "Something wrong.....", Toast.LENGTH_SHORT).show();
              }
          }
  
          @Override
          public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
              Toast.makeText(getContext(), "You're on failure", Toast.LENGTH_SHORT).show();
          }
      });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have no error in retrofit, I'm doing debugging and I see all the process, so I getting client id and secret successfully, then I'm getting a timeoutexception in the last onfailure(),     </p>
  
  <pre><code>    @Override
      public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) 
  {
      Toast.makeText(getContext(), "You're onfailure",Toast.LENGTH_SHORT).show();
  } 
  </code></pre>
  
  <p>watch the code, that's the last line. How to fix it? The app not crashes, but in debug he drops timeoutexception like this.                                            <code>t={SocketTimeoutException@830038722120}java.net.SocketTimeoutException: timeout</code> . In OkHttpClient the </p>
  
  <pre><code>readTimeout(10, TimeUnit.SECONDS).connectTimeout(10, TimeUnit.SECONDS).writeTimeout(10, TimeUnit.SECONDS);  all are 10, i tried to set it 100, not helps. Help me. Thanks.
  </code></pre>