1. removed toast

This commit is contained in:
vadym 2020-08-08 01:25:13 -07:00
parent 394a0a9177
commit 72ec1a5300

View File

@ -149,7 +149,6 @@ class MainActivity : AppCompatActivity() {
it.registerDefaultNetworkCallback(object : ConnectivityManager.NetworkCallback() {
override fun onAvailable(network: Network) {
if(isStarted) {
showToast("network on")
stopVpn()
Thread.sleep(1000)
startVpn()
@ -157,7 +156,6 @@ class MainActivity : AppCompatActivity() {
}
override fun onLost(network: Network?) {
if(isStarted) {
showToast("network off")
stopVpn()
Thread.sleep(1000)
startVpn()
@ -173,14 +171,12 @@ class MainActivity : AppCompatActivity() {
if ("android.net.conn.CONNECTIVITY_CHANGE" == intent.action) {
if (status == NetworkUtils.NETWORK_STATUS_NOT_CONNECTED) {
if(isStarted) {
showToast("network on")
stopVpn()
Thread.sleep(1000)
startVpn()
}
} else {
if(isStarted) {
showToast("network off")
stopVpn()
Thread.sleep(1000)
startVpn()