title: How to avoid FATAL EXCEPTION in OkHttp Dispatcher after callback
body: <p>I'm getting this <code>exception</code> when performing ui actions after receiving callback from <code>OkHttp</code>.</p>
  
  <blockquote>
    <p>FATAL EXCEPTION: OkHttp Dispatcher
                                                                                            Process: org.example.verificationserviceexample, PID: 20421
                                                                                            android.util.AndroidRuntimeException: Animators may only be run on Looper threads
                                                                                                at android.animation.ValueAnimator.cancel(ValueAnimator.java:1020)
                                                                                                at android.animation.AnimatorSet.cancel(AnimatorSet.java:366)
                                                                                                at android.graphics.drawable.RippleComponent.cancelSoftwareAnimations(RippleComponent.java:214)
                                                                                                at android.graphics.drawable.RippleComponent.cancel(RippleComponent.java:133)
                                                                                                at android.graphics.drawable.RippleComponent.enter(RippleComponent.java:100)
                                                                                                at android.graphics.drawable.RippleDrawable.tryBackgroundEnter(RippleDrawable.java:552)
                                                                                                at android.graphics.drawable.RippleDrawable.setBackgroundActive(RippleDrawable.java:290)
                                                                                                at android.graphics.drawable.RippleDrawable.onStateChange(RippleDrawable.java:270)
                                                                                                at android.graphics.drawable.Drawable.setState(Drawable.java:735)
                                                                                                at android.view.View.drawableStateChanged(View.java:18046)
                                                                                                at android.widget.TextView.drawableStateChanged(TextView.java:4090)
                                                                                                at android.support.v7.widget.AppCompatButton.drawableStateChanged(AppCompatButton.java:155)
                                                                                                at android.view.View.refreshDrawableState(View.java:18115)
                                                                                                at android.view.View.setEnabled(View.java:8135)
                                                                                                at android.widget.TextView.setEnabled(TextView.java:1609)
                                                                                                at org.example.verificationserviceexample.MainActivity.renderButtons(MainActivity.java:146)
                                                                                                at org.example.verificationserviceexample.MainActivity.onAudioStateChanged(MainActivity.java:170)
                                                                                                at com.bssys.spitchmobilesdk.audio.SpitchAudioManager.publishAudioStateChange(SpitchAudioManager.java:123)
                                                                                                at com.bssys.spitchmobilesdk.audio.SpitchAudioManager.stopAudio(SpitchAudioManager.java:83)
                                                                                                at com.bssys.spitchmobilesdk.VerificationService.stopAudio(VerificationService.java:96)
                                                                                                at com.bssys.spitchmobilesdk.VerificationService.stopEnrollment(VerificationService.java:57)
                                                                                                at org.example.verificationserviceexample.MainActivity.lambda$null$0$MainActivity(MainActivity.java:60)
                                                                                                at org.example.verificationserviceexample.MainActivity$$Lambda$3.onSpitchResult(Unknown Source)
                                                                                                at com.bssys.spitchmobilesdk.VerificationService$1.onFailure(VerificationService.java:111)
                                                                                                at okhttp3.RealCall$AsyncCall.execute(RealCall.java:161)
                                                                                                at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                                                at java.lang.Thread.run(Thread.java:761)</p>
  </blockquote>
  
  <p>And this is the code that I'm using:</p>
  
  <pre><code>public void addVoicePrintFromSource(Pipe source, SpitchConfig config, @NonNull String speakerId, Callback callback){
  
          RequestBody requestBody = new RequestBody() {
              @Override
              public MediaType contentType() {
                  return MediaType.parse("audio/x-pcm; rate="+config.getRate());
              }
  
              @Override
              public void writeTo(BufferedSink sink) throws IOException {
                 sink.writeAll(source.source());
              }
          };
          Request request = new Request.Builder()
         .url(config.getServerURL())
                  .addHeader("Accept","*/*")
                  .addHeader("Connection","Keep-Alive") 
                  .post(requestBody)
                  .build();
  
          okHttpClient.newCall(request).enqueue(callback);
  
      }
  </code></pre>
  
  <p>I'm using an OkIo Pipe to populate RequestBody with audio data</p>
  
  <p>Thanks in advance!</p>