参考 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() {
...
}
});
}
...
});
}
}