dynamic broadcast receiver for connectivity changes
Posted
by android-dev
on Stack Overflow
See other posts from Stack Overflow
or by android-dev
Published on 2010-05-19T20:33:06Z
Indexed on
2010/05/19
20:40 UTC
Read the original article
Hit count: 201
android
I'm trying to register a dynamic broadcast receiver using the following:
BroadcastReceiver connectivityReceiver = new ConnectivityChangeIntentReceiver(); IntentFilter connectivityFilter = new IntentFilter(); filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); filter.addAction(android.net.ConnectivityManager.CONNECTIVITY_ACTION); myApplicationContext.registerReceiver(connectivityReceiver, connectivityFilter);
but I see my ConnectivityChangeIntentReceiver.onReceive method is not called when I turn off Wifi through settings or change to airplane mode.
Has anyone faced a similar problem?
I do not want to statically register the receiver in the Manifest file, as I don't want my app to be started by connectivity changes.
© Stack Overflow or respective owner