本文整理匯總了Java中android.net.wifi.SupplicantState.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java SupplicantState.equals方法的具體用法?Java SupplicantState.equals怎麽用?Java SupplicantState.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.net.wifi.SupplicantState
的用法示例。
在下文中一共展示了SupplicantState.equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isAlreadyConnected
import android.net.wifi.SupplicantState; //導入方法依賴的package包/類
private boolean isAlreadyConnected(WifiManager wm) {
boolean alreadyConnected = false;
WifiInfo connectionInfo = wm.getConnectionInfo();
if (connectionInfo != null) {
SupplicantState supplicantState = connectionInfo.getSupplicantState();
if (supplicantState != null) {
alreadyConnected = supplicantState.equals(SupplicantState.ASSOCIATING)
|| supplicantState.equals(SupplicantState.ASSOCIATED)
|| supplicantState.equals(SupplicantState.COMPLETED)
|| supplicantState.equals(SupplicantState.FOUR_WAY_HANDSHAKE)
|| supplicantState.equals(SupplicantState.GROUP_HANDSHAKE);
}
}
return alreadyConnected;
}
示例2: onReceive
import android.net.wifi.SupplicantState; //導入方法依賴的package包/類
@Override
public void onReceive(Context context, Intent intent){
SupplicantState state = intent.getParcelableExtra(EXTRA_NEW_STATE);
if(state != null){
if(state.equals(SupplicantState.COMPLETED)){
onSuccessfulConnection();
} else if(state.equals(SupplicantState.DISCONNECTED)){
onFailedConnection();
}
}
}
示例3: getConnectionInfo
import android.net.wifi.SupplicantState; //導入方法依賴的package包/類
private WifiInfo getConnectionInfo() {
Object service = getSystemService(WIFI_SERVICE);
WifiManager manager = (WifiManager) service;
WifiInfo info = manager.getConnectionInfo();
if (info != null) {
SupplicantState state = info.getSupplicantState();
if (state.equals(SupplicantState.COMPLETED)) {
return info;
}
}
return null;
}