title: RxJava onError Can't create handler inside thread that has not called Looper.prepare()
body: <p>first i will try to explain what im trying to do, next you will see what im doing(code).
  Since im new at RxJava, and still learning fell free to give me your opinion.</p>
  
  <p>So, im calling a network API from server and when start request i call loader(spinner), when finish i hide it and same when i get an error.
  I would like this generic for all my requests so i get Observable and Observer from parameter. On this method, i just care about hide and show loader.</p>
  
  <p>OnError(and here is the trick part), im trying to show a dialog too, but i got the error that you can see on title.
  <em>Can't create handler inside thread that has not called Looper.prepare()</em></p>
  
  <p>Here is the code..</p>
  
  <pre><code>protected void makeMyrequest(MyBaseActivity myBaseActivity, Observable observable, Observer observer) {
  
      mSubscription = observable
              .doOnRequest(new Action1&lt;Long&gt;() {
                  @Override
                  public void call(Long aLong) {
  
                      Log.d(TAG, "On request");
                      myBaseActivity.showLoader();
                  }
              })
              .doOnCompleted(new Action0() {
                  @Override
                  public void call() {
                      Log.d(TAG, "onCompleted: Hide spinner");
                      myBaseActivity.hideLoader();
                      mSubscription.unsubscribe();
                  }
              })
              .doOnError(new Action1&lt;Throwable&gt;() {
                  @Override
                  public void call(Throwable throwable) {
  
                      Log.d(TAG, "onError: Hide spinner");
                          myBaseActivity.showAlertDialog("error");
                          myBaseActivity.hideLoader();
  
                                          }
              })
              .subscribeOn(Schedulers.newThread())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe(observer);
  }
  </code></pre>
  
  <p>On my base activity i have a method to show dialog</p>
  
  <pre><code>public void showAlertDialog(String message) {
  
      mDialog = new AlertDialog.Builder(this)
              .setMessage(message)
              .show();
  }
  </code></pre>
  
  <p>The part that matters from stacktracer</p>
  
  <pre><code>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
                                                                                  at android.os.Handler.&lt;init&gt;(Handler.java:200)
                                                                                  at android.os.Handler.&lt;init&gt;(Handler.java:114)
                                                                                  at android.app.Dialog.&lt;init&gt;(Dialog.java:119)
                                                                                  at android.app.Dialog.&lt;init&gt;(Dialog.java:168)
                                                                                  at android.support.v7.app.AppCompatDialog.&lt;init&gt;(AppCompatDialog.java:43)
                                                                                  at android.support.v7.app.AlertDialog.&lt;init&gt;(AlertDialog.java:95)
                                                                                  at android.support.v7.app.AlertDialog$Builder.create(AlertDialog.java:927)
                                                                                  at android.support.v7.app.AlertDialog$Builder.show(AlertDialog.java:952)
                                                                                  at xx.myapp.MyBaseActivity.showAlertDialog
  </code></pre>