Merge "Disable On/OFF switch before action"
This commit is contained in:
committed by
Android (Google) Code Review
commit
304070968a
@@ -119,11 +119,10 @@ public class WifiEnabler implements CompoundButton.OnCheckedChangeListener {
|
|||||||
mWifiManager.setWifiApEnabled(null, false);
|
mWifiManager.setWifiApEnabled(null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWifiManager.setWifiEnabled(isChecked)) {
|
mSwitch.setEnabled(false);
|
||||||
// Intent has been taken into account, disable until new state is active
|
if (!mWifiManager.setWifiEnabled(isChecked)) {
|
||||||
mSwitch.setEnabled(false);
|
|
||||||
} else {
|
|
||||||
// Error
|
// Error
|
||||||
|
mSwitch.setEnabled(true);
|
||||||
Toast.makeText(mContext, R.string.wifi_error, Toast.LENGTH_SHORT).show();
|
Toast.makeText(mContext, R.string.wifi_error, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user