Java Code Examples for android.provider.Settings#ACTION_WIFI_SETTINGS

The following examples show how to use android.provider.Settings#ACTION_WIFI_SETTINGS . These examples are extracted from open source projects. 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 Project: nearby-android   File: PlacesActivity.java    License: 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
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 Project: Synapse   File: MainActivity.java    License: 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 Project: react-native-get-location   File: SettingsUtil.java    License: 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 Project: OpenMemories-AppStore   File: ConnectActivity.java    License: 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 Project: BaseProject   File: BaseUiHelper.java    License: 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
private void openWifiSetting() {
    Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
    startActivity(intent);
}
 
Example 8
Source Project: KeyboardView   File: SystemUtil.java    License: 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);
}