我正在创建这样一个线程上的改造问题:
new Thread(new Runnable() {
@Override
public void run() {
mService.uploadFile(body)
.enqueue(new Callback<String>() {
@Override
public void onResponse(final Call<String> call, Response<String> response) {
progressDialog.dismiss();
Toast.makeText(MainActivity.this, "uploaded!", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Toast.makeText(MainActivity.this, t.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}).start();
我需要从外部通过 a取消call
输入。这怎么可能?onResponse
Thread
progressDialog.setButton()
任何帮助表示赞赏!