Hi again !
Before I go on to my question, I must just say that this is an amazing forum when starting out using B4A ! Kudos to all for that
Now my question:
How do I get the proper Extra of the retIn Object that says "Connected=True/False" from an Intent that has action=android.net.conn.CONNECTIVITY_CHANGE into a Boolean value isNetAvailable ?
My code:
/Henrik
Before I go on to my question, I must just say that this is an amazing forum when starting out using B4A ! Kudos to all for that
Now my question:
How do I get the proper Extra of the retIn Object that says "Connected=True/False" from an Intent that has action=android.net.conn.CONNECTIVITY_CHANGE into a Boolean value isNetAvailable ?
My code:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim BroadCast As BroadCastReceiver
Dim IsNetAvailable As Boolean = True
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
BroadCast.Initialize("BroadcastReceiver")
BroadCast.addAction("android.net.conn.CONNECTIVITY_CHANGE")
BroadCast.SetPriority(2147483647)
BroadCast.registerReceiver("")
End Sub
Sub BroadcastReceiver_OnReceive (Action As String, i As Object)
Dim retIn As Intent
retIn = i
If Action = "android.net.conn.CONNECTIVITY_CHANGE" Then
' How do I get the proper Extra of the retIn Object that says "Connected=True/False" ?
IsNetAvailable = .... ???
End If
Broadcast.AbortBroadcast
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
/Henrik