Hi,
The App I am currently developing needs a wifi connection, so I want
to listen to the wifi state. For example I want to display a warning
message if there is no wifi connection.
To achieve this I try to write a BroadcastReciever, here is the code I
use :
public class ConnectionChangeReceiver extends BroadcastReceiver {
public void onReceive( Context context, Intent intent ) {
Log.e("ConnectionChange","onRecieve lunch");
}
}
I declare this BroadcastReciever in the manifest (inside <activity></
activity>) :
<receiver
android:name="fr.esial.smartshare.ConnectionChangeReceiver" >
<intent-filter>
<action android:name="android.net.wifi.STATE_CHANGE"></action>
</intent-filter>
</receiver>
my application have the right permissions :
<uses-permission
android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
But I see nothing in the LogCat when I enable/disable wifi or join a
new wifi network. I don't understand what is going wrong.
Any help will be appreciate.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en