Example usage for android.net.wifi WifiConfiguration INVALID_NETWORK_ID

List of usage examples for android.net.wifi WifiConfiguration INVALID_NETWORK_ID

Introduction

In this page you can find the example usage for android.net.wifi WifiConfiguration INVALID_NETWORK_ID.

Prototype

int INVALID_NETWORK_ID

To view the source code for android.net.wifi WifiConfiguration INVALID_NETWORK_ID.

Click Source Link

Usage

From source file:com.mstar.tv.tvplayer.philips.option.OptionFirstFragment.java

private boolean isWifiConnected() {
    WifiManager wifiManager = getWifiManager();
    // wifi is disabled
    if (!wifiManager.isWifiEnabled()) {
        return false;
    }// w  ww  . j  a va2  s.  co  m

    // wifi have not connected
    WifiInfo info = wifiManager.getConnectionInfo();
    if (info == null || info.getSSID() == null || info.getNetworkId() == WifiConfiguration.INVALID_NETWORK_ID) {
        return false;
    }

    return true;
}