Import the net.rim.device.api.system.WLANInfo class. if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {…} 需要jde4.3及以上