title: Rxjava - UndeliverableException
body: <p>I'm using reactive for android for my request to backend, the problem is that the request sometimes work and sometimes not.
  and i get the exception</p>
  
  <pre><code>io.reactivex.exceptions.UndeliverableException: android.os.NetworkOnMainThreadException
  </code></pre>
  
  <p>in Mainactivity onCreate() i'm calling GetServices function which sends a post request</p>
  
  <p>Get services</p>
  
  <pre><code>public Observable&lt;Response&gt; GetService() {
  
          return Observable.fromCallable(new Callable&lt;Response&gt;() {
              @Override
              public Response call() throws Exception {
                  return RequestHelper.GetRequest("getvendoractiveservices");
              }
          });
  
      }
  
  
      public void GetServices()
      {
          GetService().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer&lt;Response&gt;() {
              @Override
              public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
  
              }
  
              @Override
              public void onNext(@io.reactivex.annotations.NonNull Response value) {
                  try {
                      Log.w("services",value.body().string()); //exception here
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
  
              }
  
              @Override
              public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                  e.printStackTrace();
              }
  
              @Override
              public void onComplete() {
  
              }
          });
      }
  </code></pre>
  
  <p>my postrequest</p>
  
  <pre><code>public static String URI="http://192.168.137.1:4000/";
      public static Response PostRequest(String api, FormBody formBody)
      {
          OkHttpClient client = new OkHttpClient();
          Request request = new Request.Builder()
                  .url(URI+api)
                  .header("carmen-token", LoginActivity.token)
                  .post(formBody)
                  .build();
  
          try {
              return client.newCall(request).execute();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return null;
      }
  </code></pre>