| | |
| | | pv.setPercent(0); |
| | | tv_ljjl.setText("0"); |
| | | tv_shishi.setText("0"); |
| | | }else if(msg.getType() == AppConfig.CHANGE_SETTING){ |
| | | if(timer!=null){ |
| | | timer.cancel(); |
| | | timer = null; |
| | | } |
| | | submitTime = MainApp.theApp.sharedPreferencesUtil.getLoginInfo().getRefresh_frequency(); |
| | | isupLoad = MainApp.theApp.sharedPreferencesUtil.getLoginInfo().getIs_open_upload(); |
| | | doTask(); |
| | | } |
| | | } |
| | | |
| | |
| | | iv_his.setOnClickListener(this); |
| | | iv_search.setOnClickListener(this); |
| | | } |
| | | |
| | | int submitTime; |
| | | int isupLoad; |
| | | @Override |
| | | protected void initData() { |
| | | submitTime = MainApp.theApp.sharedPreferencesUtil.getLoginInfo().getRefresh_frequency(); |
| | | isupLoad = MainApp.theApp.sharedPreferencesUtil.getLoginInfo().getIs_open_upload(); |
| | | doTask(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(mBluetoothService==null){ |
| | | return; |
| | | } |
| | | mBluetoothService.write(mBluetoothService.getWirteCharacteristic().getService().getUuid().toString(),mBluetoothService.getWirteCharacteristic().getUuid().toString(),"5A0014010001000000000000004600000000005B",null); |
| | | mBluetoothService.write(mBluetoothService.getWirteCharacteristic().getService().getUuid().toString(),mBluetoothService.getWirteCharacteristic().getUuid().toString(),BLECommon.BLE_SEARCH,null); |
| | | break; |
| | | } |
| | | |
| | |
| | | protected void onErrorPagerClick() { |
| | | |
| | | } |
| | | |
| | | private boolean isFinish = false; |
| | | Timer timer; |
| | | |
| | | private void doTask() { |
| | |
| | | timer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | if (!isFinish) { |
| | | if (isupLoad == 1) { |
| | | //上传数据 |
| | | submitData(); |
| | | } |
| | | } |
| | | }, 0, 10000); |
| | | }, 0, submitTime); |
| | | } |
| | | |
| | | private void submitData() { |