一、功能跳转
1、跳转系统的辅助功能界面
Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(intent);
2、飞行模式,无线网和网络设置界面
Intent intent = new Intent(Settings.ACTION_AIRPLANE_MODE_SETTINGS);
startActivity(intent);
或者
Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
startActivity(intent);
3、根据包名跳转到系统自带的应用程序信息界面
Uri packageURI = Uri.parse("package:" + "com.tencent.WBlog");
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,packageURI);
startActivity(intent);
4、跳转开发人员选项界面
Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
startActivity(intent);
5、跳转应用程序列表界面
Intent intent = new Intent(Settings.ACTION_APPLICATION_SETTINGS);
startActivity(intent);
Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS);
startActivity(intent);
Intent intent = new Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
startActivity(intent);
6、跳转蓝牙设置界面
Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
startActivity(intent);
7、跳转到移动网络设置界面
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
8、跳转日期时间设置界面
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
9、跳转手机详情界面
Intent intent = new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS);
startActivity(intent);
10、跳转语言和输入设备
Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS);
startActivity(intent);
11、跳转 语言选择界面
Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS);
startActivity(intent);
12、跳转存储设置界面【内部存储】
Intent intent = new Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS);
startActivity(intent);
13、跳转 存储设置 【记忆卡存储】
Intent intent = new Intent(Settings.ACTION_MEMORY_CARD_SETTINGS);
startActivity(intent);
14、跳转语言选择界面【仅有English 和 中文两种选择】
Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
startActivity(intent);
15、跳转位置服务界面
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
16、跳转到 显示设置选择网络运营商。
Intent intent = new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
startActivity(intent);
17、显示NFC共享设置。
Intent intent = new Intent(Settings.ACTION_NFCSHARING_SETTINGS);
startActivity(intent);
18、显示NFC设置。这显示了用户界面,允许NFC打开或关闭。
Intent intent = new Intent(Settings.ACTION_NFC_SETTINGS);
startActivity(intent);
19、跳转到安全设置界面
Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
startActivity(intent);
20、跳转到设置界面
Intent intent = new Intent(Settings.ACTION_SETTINGS);
startActivity(intent);
21、跳转到声音设置界面
Intent intent = new Intent(Settings.ACTION_SOUND_SETTINGS);
startActivity(intent);
22、跳转账户同步界面
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
startActivity(intent);
二、判断系统服务是否打开
1、位置服务
public boolean isLocationEnabled() {
int locationMode = 0;
String locationProviders;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
try {
locationMode = Settings.Secure.getInt(getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
return false;
}
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
}else{
locationProviders = Settings.Secure.getString(getActivity().getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
return !TextUtils.isEmpty(locationProviders);
}
}
2、判断网络是否打开
public static boolean isNetWorkAvailable(Context context){
boolean isAvailable = false ;
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
if(networkInfo!=null && networkInfo.isAvailable()){
isAvailable = true;
}
return isAvailable;
}
3、判断当前网络是否为 wifi
@SuppressWarnings("static-access")
public static boolean isWiFiConnected(Context context){
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
return networkInfo.getType() == manager.TYPE_WIFI ? true : false;
}
4、 判断MOBILE网络是否可用
public static boolean isMobileDataEnable(Context context){
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
boolean isMobileDataEnable = false;
isMobileDataEnable = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();
return isMobileDataEnable;
}
5、判断wifi 是否可用
public static boolean isWifiDataEnable(Context context){
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
boolean isWifiDataEnable = false;
isWifiDataEnable = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();
return isWifiDataEnable;
}
6、判断是否打开了开发者模式
boolean enableAdb = (Settings.Secure.getInt(getContentResolver(), Settings.Secure.ADB_ENABLED, 0) > 0);
7、判断 蓝牙是否打开
public static boolean isOpenBluetooth(){
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
return adapter.isEnabled();
}