| | |
| | | public class DeviceMng {
|
| | | public static DeviceMng instance = new DeviceMng();
|
| | |
|
| | | public static String authorationId = null;
|
| | | public static String authorationId = "101";
|
| | |
|
| | | public static DeviceMng getInstance() {
|
| | | return instance;
|
| | |
| | |
|
| | | public void load () {
|
| | | try {
|
| | | if (authorationId == null || authorationId.trim().length() <= 1) {
|
| | | getAuthorationId();
|
| | | return;
|
| | | }
|
| | | // if (authorationId == null || authorationId.trim().length() <= 1) {
|
| | | // getAuthorationId();
|
| | | // MainActivity.getInstance().runOnUiThread(new Runnable() {
|
| | | // @Override
|
| | | // public void run() {
|
| | | // Toast.makeText(MainActivity.getInstance(), "请填写设备序列号", Toast.LENGTH_SHORT).show();
|
| | | // }
|
| | | // });
|
| | | // return;
|
| | | // }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL + AppApi.Query.DEVICE_QUERY);
|
| | | params.addBodyParameter(Device.FieldNames.authorizationId, authorationId);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|