在做android开发时,常常会有需要打开系统设置的需求。这时,我们就要通过intent调用对应的设置界面。
调用代码其实很简单,如下:
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.android.settings","com.android.settings.WirelessSettings");
intent.setComponent(comp);
intent.setAction("android.intent.action.VIEW");
startActivity(intent);
当然,你也可以用startActivityForResult来进行一些设置完成后的工作,具体实现视需求而定。以下是我在网上查到的一些可以直接调用的Settings的界面,有一些在测试的时候不可用,见注释。
"选择活动", "com.android.settings.ActivityPicker"
"设置GSM/UMTS波段", "com.android.settings.BandMode"
"电池信息", "com.android.settings.BatteryInfo"
"日期和时间设置2", "com.android.settings.DateTimeSettingsSetupWizard"
"开发者选项", "com.android.settings.DevelopmentSettings"
"设备管理器", "com.android.settings.DeviceAdminSettings"
"显示字体大小及预览", "com.android.settings.Display"
"显示设置", "com.android.settings.DisplaySettings"
"语言和输入法", "com.android.settings.LanguageSettings"
"管理应用", "com.android.settings.ManageApplications"
"格式化手机闪存", "com.android.settings.MediaFormat"
"代理设置", "com.android.settings.ProxySelector"
"手机信息", "com.android.settings.RadioInfo"
"正在运行的程序", "com.android.settings.RunningServices"
"安全设置", "com.android.settings.SecuritySettings"
"设置", "com.android.settings.Settings"
"安全信息", "com.android.settings.SettingsSafetyLegalActivity"
"声音设置", "com.android.settings.SoundSettings"
"测试", "com.android.settings.TestingSettings"
"绑定与便携式热点", "com.android.settings.TetherSettings"
"使用情况统计", "com.android.settings.UsageStats"
"用户词典", "com.android.settings.UserDictionarySettings"
"辅助功能设置", "com.android.settings.AccessibilitySettings" //找不到
"APN设置", "com.android.settings.ApnSettings" //不能跳转
"应用程序设置", "com.android.settings.ApplicationSettings" //找不到
"日期和时间设置", "com.android.settings.DateTimeSettings" //找不到
"关于手机", "com.android.settings.DeviceInfoSettings" //找不到
"底座设置", "com.android.settings.DockSettings" //找不到
"SIM卡锁定设置", "com.android.settings.IccLockSettings" //闪退
"语言和键盘设置", "com.android.settings.InstalledAppDetails" //找不到
"选择手机语言", "com.android.settings.LocalePicker" //找不到
"选择手机语言2", "com.android.settings.LocalePickerInSetupWizard" //找不到
"恢复出厂设置", "com.android.settings.MasterClear" //找不到
"设置键盘", "com.android.settings.PhysicalKeyboardSettings" //找不到
"隐私设置", "com.android.settings.PrivacySettings" //找不到
"文字转语音设置", "com.android.settings.TextToSpeechSettings" //找不到
"语音输入与输出设置", "com.android.settings.VoiceInputOutputSettings" //找不到
"无线和网络设置", "com.android.settings.WirelessSettings" //找不到
我写了一个demo,列出了具体报名并实现其跳转,有兴趣的童鞋可以下下来看下。
http://pan.baidu.com/s/1pJGyxez