예제 #1
0
 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);
 }
예제 #2
0
 // 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();
 }
예제 #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() + ')';
 }