Fix onServiceDisconnected not called
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
package be.mygod.vpnhotspot.util
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.*
|
||||
import android.databinding.BindingAdapter
|
||||
import android.support.annotation.DrawableRes
|
||||
import android.util.Log
|
||||
@@ -53,3 +50,8 @@ fun thread(name: String? = null, start: Boolean = true, isDaemon: Boolean = fals
|
||||
if (start) thread.start()
|
||||
return thread
|
||||
}
|
||||
|
||||
fun Context.stopAndUnbind(connection: ServiceConnection) {
|
||||
connection.onServiceDisconnected(null)
|
||||
unbindService(connection)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user