Java Code Examples for android.provider.Settings#ACTION_WIFI_SETTINGS

The following examples show how to use android.provider.Settings#ACTION_WIFI_SETTINGS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlacesActivity.java    From nearby-android with Apache License 2.0 6 votes vote down vote up
private void checkSettings() {
  // Is GPS enabled?
  final boolean gpsEnabled = locationTrackingEnabled();
  // Is there internet connectivity?
  final boolean internetConnected = internetConnectivity();

  if (gpsEnabled && internetConnected) {
    completeSetUp();
  } else if (!gpsEnabled) {
    final Intent gpsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
    showDialog(gpsIntent, REQUEST_LOCATION_SETTINGS, getString(R.string.location_tracking_off));
  } else {
    final Intent internetIntent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    showDialog(internetIntent, REQUEST_WIFI_SETTINGS, getString(R.string.wireless_off));
  }
}
 
Example 2
Source File: MapsAppActivity.java    From maps-app-android with Apache License 2.0 6 votes vote down vote up
private void checkSettings() {
	// Is GPS enabled?
	boolean gpsEnabled = locationTrackingEnabled();
	// Is there internet connectivity?
	boolean internetConnected = internetConnectivity();

	if (gpsEnabled && internetConnected) {
		setView();
	}else if (!gpsEnabled) {
		Intent gpsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
		showDialog(gpsIntent, REQUEST_LOCATION_SETTINGS, getString(R.string.location_tracking_off));
	}else {
		Intent internetIntent = new Intent(Settings.ACTION_WIFI_SETTINGS);
		showDialog(internetIntent, REQUEST_WIFI_SETTINGS, getString(R.string.wireless_off));
	}
}
 
Example 3
Source File: MainActivity.java    From Synapse with Apache License 2.0 5 votes vote down vote up
private void toSetting() {
    try {
        final Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
        startActivity(intent);
    } catch (Exception e) {
        ExceptionHelper.getInstance()
                .caught(e);
    }
}
 
Example 4
Source File: SettingsUtil.java    From react-native-get-location with MIT License 4 votes vote down vote up
public static void openWifiSettings(final Context context) {
    Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    context.startActivity(intent);
}
 
Example 5
Source File: ConnectActivity.java    From OpenMemories-AppStore with MIT License 4 votes vote down vote up
public void onSettingsButtonClicked(View view) {
    String action = Environment.isCamera() ? "com.sony.scalar.app.wifisettings.WifiSettings" : Settings.ACTION_WIFI_SETTINGS;
    keepWifiOn();
    startActivity(new Intent(action));
}
 
Example 6
Source File: BaseUiHelper.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
/**
 * 跳转到Wifi设备界面
 * @param context
 * @return
 */
public static boolean jumpToWifiSetting(Context context) {
    Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    context.startActivity(intent);
    return true;
}
 
Example 7
Source File: ConfirmationFragmentForApi29.java    From DeviceConnect-Android with MIT License 4 votes vote down vote up
private void openWifiSetting() {
    Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    startActivity(intent);
}
 
Example 8
Source File: SystemUtil.java    From KeyboardView with Apache License 2.0 2 votes vote down vote up
/**
 * 打开手机WIFI设置界面
 *
 * @param context
 */
public static void openWifiSetting(Context context) {
    Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    context.startActivity(intent);
}