fix [获取指导员备注信息 为空时的闪退问题]
This commit is contained in:
parent
7e6a296722
commit
7c669b338f
@ -4,12 +4,16 @@ import android.content.Context;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.lzy.okgo.model.Response;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.http.JsonBean;
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -36,8 +40,12 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
|||||||
*/
|
*/
|
||||||
public Map<String, String> getInstructorRemark() {
|
public Map<String, String> getInstructorRemark() {
|
||||||
if (null == instructorRemarkMap) {
|
if (null == instructorRemarkMap) {
|
||||||
instructorRemarkMap = JSON.parseObject(getString(KEY_INSTRUCTOR_REMARK), new TypeReference<Map<String, String>>() {
|
String string = getString(KEY_INSTRUCTOR_REMARK);
|
||||||
});
|
if (!StringUtil.isEmpty(string)) {
|
||||||
|
instructorRemarkMap = JSON.parseObject(string, new TypeReference<Map<String, String>>() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (instructorRemarkMap == null) {
|
if (instructorRemarkMap == null) {
|
||||||
instructorRemarkMap = new HashMap<>();
|
instructorRemarkMap = new HashMap<>();
|
||||||
@ -103,8 +111,8 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
|||||||
public void run() {
|
public void run() {
|
||||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||||
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
|
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
|
||||||
.params("uid", userInfo.getId(),true)
|
.params("uid", userInfo.getId(), true)
|
||||||
.params("token", userInfo.getToken(),true)
|
.params("token", userInfo.getToken(), true)
|
||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@ -116,6 +124,11 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Response<JsonBean> response) {
|
||||||
|
super.onError(response);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user