I have made use of a BroadcastReceiver
for IntentFilter
named android.net.conn.CONNECTIVITY_CHANGE
but while checking through the emulator, I found out that even if there is no true connectivity to the internet, if the mobile data is switched on in the emulator it shows that the connection is alive.
CASE | MO_DATA | MO_WIFI | PC_INTER | RESP
---- | ------- | ------- | -------- | ----
1 | ON | ON | ON | ON
2 | ON | OFF | ON | ON
3 | OFF | ON | ON | ON
4 | OFF | OFF | ON | OFF
5 | ON | ON | OFF | ON
6 | ON | OFF | OFF | ON
7 | OFF | ON | OFF | ON
8 | OFF | OFF | OFF | OFF
The response shows ON even when there is no internet connectivity in the PC in cases 5, 6 and 7 above only because either of mobile data/wifi or both are switched ON and the actual status of non-availability of internet is not reflected.
Is there any way to solve this issue?