final void wifiConnect(WifiParsedResult wifiResult) {
   Intent intent = new Intent(Intents.WifiConnect.ACTION);
   intent.setClassName(activity, WifiActivity.class.getName());
   putExtra(intent, Intents.WifiConnect.SSID, wifiResult.getSsid());
   putExtra(intent, Intents.WifiConnect.TYPE, wifiResult.getNetworkEncryption());
   putExtra(intent, Intents.WifiConnect.PASSWORD, wifiResult.getPassword());
   launchIntent(intent);
 }
 // Display the name of the network and the network type to the user.
 @Override
 public CharSequence getDisplayContents() {
   WifiParsedResult wifiResult = (WifiParsedResult) getResult();
   StringBuilder contents = new StringBuilder(50);
   String wifiLabel = getActivity().getString(R.string.wifi_ssid_label);
   ParsedResult.maybeAppend(wifiLabel + '\n' + wifiResult.getSsid(), contents);
   String typeLabel = getActivity().getString(R.string.wifi_type_label);
   ParsedResult.maybeAppend(typeLabel + '\n' + wifiResult.getNetworkEncryption(), contents);
   return contents.toString();
 }
Exemple #3
0
 // Display the name of the network and the network type to the user.
 @Override
 public CharSequence getDisplayContents() {
   WifiParsedResult wifiResult = (WifiParsedResult) getResult();
   return wifiResult.getSsid() + " (" + wifiResult.getNetworkEncryption() + ')';
 }