WifiResultHandler.java (zxing-zxing-3.4.1) | : | WifiResultHandler.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 64 | skipping to change at line 64 | |||
@Override | @Override | |||
public int getButtonText(int index) { | public int getButtonText(int index) { | |||
return R.string.button_wifi; | return R.string.button_wifi; | |||
} | } | |||
@Override | @Override | |||
public void handleButtonPress(int index) { | public void handleButtonPress(int index) { | |||
if (index == 0) { | if (index == 0) { | |||
WifiParsedResult wifiResult = (WifiParsedResult) getResult(); | WifiParsedResult wifiResult = (WifiParsedResult) getResult(); | |||
WifiManager wifiManager = (WifiManager) getActivity().getApplicationContex | WifiManager wifiManager = | |||
t().getSystemService(Context.WIFI_SERVICE); | (WifiManager) getActivity().getApplicationContext().getSystemService(C | |||
ontext.WIFI_SERVICE); | ||||
if (wifiManager == null) { | if (wifiManager == null) { | |||
Log.w(TAG, "No WifiManager available from device"); | Log.w(TAG, "No WifiManager available from device"); | |||
return; | return; | |||
} | } | |||
final Activity activity = getActivity(); | final Activity activity = getActivity(); | |||
activity.runOnUiThread(new Runnable() { | activity.runOnUiThread(new Runnable() { | |||
@Override | @Override | |||
public void run() { | public void run() { | |||
Toast.makeText(activity.getApplicationContext(), R.string.wifi_changin g_network, Toast.LENGTH_SHORT).show(); | Toast.makeText(activity.getApplicationContext(), R.string.wifi_changin g_network, Toast.LENGTH_SHORT).show(); | |||
} | } | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added |