Sub Service_Start (StartingIntent As Intent)
If StartingIntent.Action = "android.net.wifi.STATE_CHANGE" Then
Dim jo As JavaObject = StartingIntent
Dim NetInfo As Object = jo.RunMethodJO("getParcelableExtra",Array("networkInfo")).RunMethod("getDetailedState",Null)
Dim State As JavaObject : State.InitializeStatic("android.net.NetworkInfo.DetailedState")
If (NetInfo <> State.GetField("DISCONNECTED") And NetInfo <> State.GetField("CONNECTED") Or (NetInfo = State.GetField("DISCONNECTED") And Not(StartingIntent.HasExtra("bssid")))) Then Return
LogColor("SentNotification:Service_Start: Connection event: "&NetInfo,Colors.Red)
end if