@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(); } } } }
@Override public void onReceive(Context context, Intent intent) { WifiInfo wifiInfo = wfmgr.getConnectionInfo(); Log.d(Constants.TAG, "WearMenuFragment getSSID wifiInfo.getSupplicantState: " + wifiInfo.getSupplicantState()); Log.d(Constants.TAG, "WearMenuFragment getSSID wifiInfo.SSID: " + wifiInfo.getSSID()); Log.d(Constants.TAG, "WearMenuFragment getSSID action: " + intent.getAction()); Log.d(Constants.TAG, "WearMenuFragment getSSID connected: " + intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false)); if (wifiInfo.getSupplicantState().equals(SupplicantState.ASSOCIATED)) flag = true; if (wifiInfo.getSupplicantState().equals(SupplicantState.COMPLETED) && flag) { flag = false; vibrator.vibrate(100); Toast.makeText(mContext, "Wi-Fi Connected to:\n" + wifiInfo.getSSID(), Toast.LENGTH_SHORT).show(); } } };
@Override public void onReceive(Context context, Intent intent) { WifiInfo wifiInfo = wfmgr.getConnectionInfo(); Log.d(Constants.TAG, "AmazModLauncher getSSID wifiInfo.getSupplicantState: " + wifiInfo.getSupplicantState()); Log.d(Constants.TAG, "AmazModLauncher getSSID wifiInfo.SSID: " + wifiInfo.getSSID()); Log.d(Constants.TAG, "AmazModLauncher getSSID action: " + intent.getAction()); Log.d(Constants.TAG, "AmazModLauncher getSSID connected: " + intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false)); if (wifiInfo.getSupplicantState().equals(SupplicantState.ASSOCIATED)) flag = true; if (wifiInfo.getSupplicantState().equals(SupplicantState.COMPLETED) && flag) { flag = false; vibrator.vibrate(100); Toast.makeText(mContext, "Wi-Fi Connected to:\n" + wifiInfo.getSSID(), Toast.LENGTH_SHORT).show(); } } };
@Override public void onReceive(Context context, Intent intent) { WifiInfo wifiInfo = wfmgr.getConnectionInfo(); Log.d(Constants.TAG, "WearActivity getSSID wifiInfo.getSupplicantState: " + wifiInfo.getSupplicantState()); Log.d(Constants.TAG, "WearActivity getSSID wifiInfo.SSID: " + wifiInfo.getSSID()); Log.d(Constants.TAG, "WearActivity getSSID action: " + intent.getAction()); Log.d(Constants.TAG, "WearActivity getSSID connected: " + intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false)); if (wifiInfo.getSupplicantState().equals(SupplicantState.ASSOCIATED)) flag = true; if (wifiInfo.getSupplicantState().equals(SupplicantState.COMPLETED) && flag) { flag = false; vibrator.vibrate(100); Toast.makeText(getApplicationContext(), "Wi-Fi Connected to:\n" + wifiInfo.getSSID(), Toast.LENGTH_SHORT).show(); } } };