u can also use this method
//Check weather Internet connection is available or not
public boolean checkInternetConnection() {
final ConnectivityManager conMgr = (ConnectivityManager)
getSystemService (Context.CONNECTIVITY_SERVICE);
if (conMgr.getActiveNetworkInfo() != null &&
conMgr.getActiveNetworkInfo().isAvailable() &&
conMgr.getActiveNetworkInfo().isConnected()) {
return true;
} else {
System.out.println("Internet Connection Not
Present");
return false;
}
}
include this in manifest file
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
--
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