Commit b632147d authored by gaoyingxiang's avatar gaoyingxiang

修改定时器

parent 1a1aa7f5
...@@ -19,6 +19,7 @@ public class RxTimerUtil { ...@@ -19,6 +19,7 @@ public class RxTimerUtil {
private static Disposable mDisposableTime; private static Disposable mDisposableTime;
private static Disposable mDisposableSocket; private static Disposable mDisposableSocket;
private static Disposable mDisposablepPrint; private static Disposable mDisposablepPrint;
private static Disposable mDisposableOther;
/** /**
* milliseconds毫秒后执行next操作 * milliseconds毫秒后执行next操作
...@@ -81,6 +82,8 @@ public class RxTimerUtil { ...@@ -81,6 +82,8 @@ public class RxTimerUtil {
case SysCode.RX_TIMER_TYPE.PRINT: case SysCode.RX_TIMER_TYPE.PRINT:
mDisposablepPrint = disposable; mDisposablepPrint = disposable;
break; break;
case SysCode.RX_TIMER_TYPE.OTHER:
mDisposableOther = disposable;
} }
} }
...@@ -127,6 +130,11 @@ public class RxTimerUtil { ...@@ -127,6 +130,11 @@ public class RxTimerUtil {
Log.e(TAG, "====定时器取消mDisposablepPrint======"); Log.e(TAG, "====定时器取消mDisposablepPrint======");
} }
break; break;
case SysCode.RX_TIMER_TYPE.OTHER:
if (mDisposableOther != null && !mDisposableOther.isDisposed()) {
mDisposableOther.dispose();
Log.e(TAG, "====定时器取消mDisposableOther======");
}
} }
} }
......
...@@ -12,6 +12,7 @@ public class SysCode { ...@@ -12,6 +12,7 @@ public class SysCode {
int TIME = 0; int TIME = 0;
int SOCKET = 1; int SOCKET = 1;
int PRINT = 2; int PRINT = 2;
int OTHER = 3;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment