«`java
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
public class SettingsHelper {
public static void openBrightnessSetting(Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Intent intent = new Intent();
String packageName = «com.android.settings»;
String action = Settings.ACTION_MANAGE_WRITE_SETTINGS;
Uri uri = Uri.parse(«package:» + packageName);
intent.setAction(action);
intent.setData(uri);
activity.startActivityForResult(intent, 0);
} else {
// For devices with API level lower than Marshmallow
Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
activity.startActivityForResult(intent, 0);
}
}
public static void openNetworkSetting(Context context) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_WIFI_SETTINGS);
context.startActivity(intent);
}
public static void openSoundSetting(Context context) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_SOUND_SETTINGS);
context.startActivity(intent);
}
public static void openSecuritySetting(Context context) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_SECURITY_SETTINGS);
context.startActivity(intent);
}
public static void openAccessibilitySetting(Context context) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_ACCESSIBILITY_SETTINGS);
context.startActivity(intent);
}
}
«`