<pre name="code" class="java">正确
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == 2){
moveWork(TestActivity.this,workId);
}
}
/**
* 移动作品
*/
public void moveWork(Context context, String workId) {
Map<String, String> map = new HashMap<>();
String uid = ApiUtil.getUid();
map.clear();
int time = ComplexPreferences.getTime();
if (time == 0) {
map.put("time", System.currentTimeMillis() + "");
} else {
map.put("time", time + "");
}
map.put("work_set_privacy",ComplexPreferences.getWorkSetPrivacy());
map.put("work_set_id",ComplexPreferences.getWorkSetId());
map.put("work_id", workId);
map.put("uid", uid);
String SIGN = null;
if (uid.equals("0")) {
SIGN = ApiUtil.getWithoutTokenSigned(map);
} else {
SIGN = ApiUtil.getWithTokenSigned(map);
}
map.put("sign", SIGN);
Log.d("TestActivity", "map:" + map);
OkHttpClientUtil.postAsyn(IClientUrl.MOVE_WORK, new OkHttpClientUtil.ResultCallback<String>() {
@Override
public void onError(Request request, Exception e) {
L.d(e.toString());
}
@Override
public void onResponse(String response) {
L.d("moveWork:", response);
Gson gson = new Gson();
if (ApiUtil.isSuccess(response, gson)) {
To.showShort(context, "移动作品成功");
<span style="background-color: rgb(255, 0, 0);">//等移动完成后再执行
cDetails(workId);</span>
} else {
To.showShort(context, "移动作品失败");
}
}
}, map);
}
错误:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == 2){
moveWork(TestActivity.this,workId);
cDetails(workId);
}
}