fix crash on proxy only mode

This commit is contained in:
Kr328 committed 2019-12-19 21:44:15 +08:00
1 parent a49899add3
commit ed63036329
1 file changed
+4
@@ -12,6 +12,7 @@ import com.github.kr328.clash.core.Clash
import com.github.kr328.clash.core.event.*
import com.github.kr328.clash.core.utils.Log
import java.util.concurrent.Executors
import kotlin.concurrent.thread
class ClashService : Service(), IClashEventObserver {
private val executor = Executors.newSingleThreadExecutor()
@@ -102,6 +103,9 @@ class ClashService : Service(), IClashEventObserver {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
super.onStartCommand(intent, flags, startId)
notification.setVpn(false)
notification.show()
instance.clash.start()
return START_NOT_STICKY