Hello, i am checking networking connection using the below code:
public static boolean haveInternet(Context ctx)
{
NetworkInfo info = (NetworkInfo) ((ConnectivityManager)
ctx.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (info == null || !info.isConnected()) {
return false; // no connection
}
return true; // true if having connection
}
Now, on "no connection" , i am launching "Wireless settings" dialog
using the below code:
context.startActivity(new
Intent(Settings.ACTION_WIRELESS_SETTINGS));
but, user is being able to "on/off" the wireless, now how do i come to
know whether the user has made "on" the wi-fi or not? what result is
returned by the above intent on the successful wireless connection.
how do i check it ?
--
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