xuxiuxi
2017-03-29 d17be73f53c21c5ceae03fe8494c195f0bbf4abf
VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/service/PlaceMng.java
@@ -10,7 +10,7 @@
import java.util.List;
import cn.com.basic.face.discern.common.ResultBean;
import cn.com.basic.face.discern.common.BaseCommonCallBack;
import cn.com.basic.face.discern.entity.Place;
/**
@@ -30,13 +30,16 @@
        try {
            RequestParams params = new RequestParams(AppApi.BASEURL + AppApi.PLACE_LIST);
            params.addBodyParameter(Place.FieldNames.authorizationId, authorationId);
            ResultBean resultBean = x.http().postSync(params, ResultBean.class);
            List<Place> places = resultBean.getListBeanOfType(Place.class);
            if (places.size() > 0) {
                BaseApplication.getInstance().setPlace(places.get(0));
            } else {
                Toast.makeText(BaseApplication.getInstance(), "数据库中找不到该设备", Toast.LENGTH_SHORT).show();
            }
            x.http().post(params, new BaseCommonCallBack() {
                public void success() {
                    List<Place> places = resultBean.getListBeanOfType(Place.class);
                    if (places.size() > 0) {
                        BaseApplication.getInstance().setPlace(places.get(0));
                    } else {
                        Toast.makeText(BaseApplication.getInstance(), "数据库中找不到该设备", Toast.LENGTH_SHORT).show();
                    }
                }
            });
        } catch (Throwable e) {
            e.printStackTrace();
            Toast.makeText(BaseApplication.getInstance(), "数据库中找不到该设备", Toast.LENGTH_SHORT).show();