|
@@ -24,10 +24,14 @@ class TcpHandleService : Service(){
|
|
|
|
|
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
Log.i("TcpHandleService", "已经启动")
|
|
Log.i("TcpHandleService", "已经启动")
|
|
- EventBus.getDefault().register(this)
|
|
|
|
return super.onStartCommand(intent, flags, startId)
|
|
return super.onStartCommand(intent, flags, startId)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override fun onCreate() {
|
|
|
|
+ super.onCreate()
|
|
|
|
+ EventBus.getDefault().register(this)
|
|
|
|
+ }
|
|
|
|
+
|
|
override fun onDestroy() {
|
|
override fun onDestroy() {
|
|
EventBus.getDefault().unregister(this)
|
|
EventBus.getDefault().unregister(this)
|
|
super.onDestroy()
|
|
super.onDestroy()
|