一、打开系统设置
1.SDK4.0以下:
Intent intent = new Intent();
ComponentName cn = new ComponentName("com.android.settings",
"com.android.settings.WirelessSettings");
intent.setComponent(cn);
intent.setAction("android.intent.action.VIEW");
startActivity(intent);
2.SDK4.0以上:
Intent intent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);
3.系统设置相关跳转:
android.provider.Settings.ACTION_SETTINGS //系统设置
android.provider.Settings.ACTION_APN_SETTINGS //接入点设置
android.provider.Settings.ACTION_SOUND_SETTINGS //声音设置
android.provider.Settings.ACTION_WIRELESS_SETTINGS //网络设置
android.provider.Settings.ACTION_SECURITY_SETTINGS //安全设置
android.provider.Settings.ACTION_WIFI_SETTINGS //WiFi设置
android.provider.Settings.ACTION_BLUETOOTH_SETTINGS //蓝牙设置
android.provider.Settings.ACTION_DATE_SETTINGS //日期和时间设置
android.provider.Settings.ACTION_BLUETOOTH_SETTINGS //蓝牙设置
二、app中打开第三方应用
方法一
Intent intent=new Intent();
//包名 包名+类名(全路径)
intent.setClassName("包名", "包名+类名”);
startActivity(intent);
方法二
Intent intent = new Intent();
ComponentName comp = new ComponentName("包名", "包名+类名”);
intent.setComponent(comp);
intent.setAction("android.intent.action.MAIN");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
方法三
//包名
context.startActivity(context.getPackageManager().
getLaunchIntentForPackage("包名"));