Only the original thread that created a view hierarchy can touch its views

参考 https://blog.csdn.net/djx123456/article/details/6325983

public class MainActivity extends AppComatActiviey {

  private final Handler handler = new Handler();

  protected void onCreate(Bundle bundle) {

    ...

    otherMethod();

    ...

  }

       private void otherMethod() {

    xxx(new Callback() {

      ...

      public void onResponse(...) {

        handler.post(new Runnable() {

          public void run() {

            ...

          }

        });

      }

      ...

    });

  }

}

原文地址:https://www.cnblogs.com/white-knight/p/9772025.html