Merge remote-tracking branch 'origin/master'

This commit is contained in:
董宏宇
2021-02-02 10:19:14 +08:00
3 changed files with 15 additions and 11 deletions

View File

@@ -38,19 +38,21 @@ public class UploadInTimeHandler {
}
public void start() {
mHandler = new Handler(WorkThreadHandler.newInstance(TAG).getLooper()) {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_DATA_CHANGED) {
mHandler.sendEmptyMessageDelayed(MSG_DATA_CHANGED, uploadDelay);
if (iUploadInTimeListener != null) {
iUploadInTimeListener.sendLocationData();
if (mHandler == null) {
mHandler = new Handler(WorkThreadHandler.newInstance(TAG).getLooper()) {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_DATA_CHANGED) {
mHandler.sendEmptyMessageDelayed(MSG_DATA_CHANGED, uploadDelay);
if (iUploadInTimeListener != null) {
iUploadInTimeListener.sendLocationData();
}
}
}
}
};
mHandler.sendEmptyMessage(MSG_DATA_CHANGED);
};
mHandler.sendEmptyMessage(MSG_DATA_CHANGED);
}
}
public void setUploadInTimeListener(IUploadInTimeListener uploadInTimeListener) {