How to check availability of internet connection(Wifi, GPRS, EDGE) in Blackberry.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Try this....it worked for me .
protected static boolean isInternetAvailable() {
boolean flag = false;
if(WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED){
flag = true;
}
else if(RadioInfo.isDataServiceOperational()){
flag = true;
}
return flag;
}