Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Android应用程序跳转到系统的各个设置页面

在开发过程中,当我们的程序检测到某个功能项没打开或者没设置的时候,需要我们在程序中跳转设置页面供用户设置后返回我们的程序才能用我们程序的某一功能,这样,我们就有必要去了解以下内容:在Android SDK文档中有这样一个类,android.provider.Settings类提供android系统各个页面的跳转常量:使用实例例:startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)),即可跳到android手机网络设置页面。如果要launch Mobile Networks Setting页面按如下方法:
Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
ComponentName cName = new ComponentName(“com.android.phone”,”com.android.phone.Settings”);
intent.setComponent(cName);
startActivity(intent);
如果要进入Networks Operators页面按如下方法:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName(“com.android.phone”, “com.android.phone.NetworkSetting”);
startActivity(intent);以上为网上提供的跳转方法是从自己软件的包名跳转到系统的包名,大家都知道,android特别的烂,时不时改变程序的结构,不同版本可能包名什么不一样的,此外,android应用层的包名若是不知道,则无法跳转,经不认真测试,好像会报错,个人感觉也是特别的麻烦。然而android为我们提供比startActivity更加简便的方法,就是startActivityForResult,使用startActivityForResult跳转设置页面设置完成后还可以返回自己的程序页面。下面是个人的实现方法:比如,我要跳转系统”辅助功能“设置页面,则用一下代码即可:Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivityForResult(intent, REQUESTCODE);备注:REQUESTCODE为声明的静态 int 型常量==================== 以下为跳转个设置页面的参数  =============================
Constants
StringACTION_ACCESSIBILITY_SETTINGSActivity Action: Show settings for accessibility modules.
StringACTION_ADD_ACCOUNTActivity Action: Show add account screen for creating a new account.
StringACTION_AIRPLANE_MODE_SETTINGSActivity Action: Show settings to allow entering/exiting airplane mode.
StringACTION_APN_SETTINGSActivity Action: Show settings to allow configuration of APNs.
StringACTION_APPLICATION_DETAILS_SETTINGSActivity Action: Show screen of details about a particular application.
StringACTION_APPLICATION_DEVELOPMENT_SETTINGSActivity Action: Show settings to allow configuration of application development-related settings.
StringACTION_APPLICATION_SETTINGSActivity Action: Show settings to allow configuration of application-related settings.
StringACTION_BLUETOOTH_SETTINGSActivity Action: Show settings to allow configuration of Bluetooth.
StringACTION_DATA_ROAMING_SETTINGSActivity Action: Show settings for selection of 2G/3G.
StringACTION_DATE_SETTINGSActivity Action: Show settings to allow configuration of date and time.
StringACTION_DEVICE_INFO_SETTINGSActivity Action: Show general device information settings (serial number, software version, phone number, etc.).
StringACTION_DISPLAY_SETTINGSActivity Action: Show settings to allow configuration of display.
StringACTION_INPUT_METHOD_SETTINGSActivity Action: Show settings to configure input methods, in particular allowing the user to enable input methods.
StringACTION_INPUT_METHOD_SUBTYPE_SETTINGSActivity Action: Show settings to enable/disable input method subtypes.
StringACTION_INTERNAL_STORAGE_SETTINGSActivity Action: Show settings for internal storage.
StringACTION_LOCALE_SETTINGSActivity Action: Show settings to allow configuration of locale.
StringACTION_LOCATION_SOURCE_SETTINGSActivity Action: Show settings to allow configuration of current location sources.
StringACTION_MANAGE_ALL_APPLICATIONS_SETTINGSActivity Action: Show settings to manage all applications.
StringACTION_MANAGE_APPLICATIONS_SETTINGSActivity Action: Show settings to manage installed applications.
StringACTION_MEMORY_CARD_SETTINGSActivity Action: Show settings for memory card storage.
StringACTION_NETWORK_OPERATOR_SETTINGSActivity Action: Show settings for selecting the network operator.
StringACTION_NFCSHARING_SETTINGSActivity Action: Show NFC Sharing settings.
StringACTION_NFC_SETTINGSActivity Action: Show NFC settings.
StringACTION_PRIVACY_SETTINGSActivity Action: Show settings to allow configuration of privacy options.
StringACTION_QUICK_LAUNCH_SETTINGSActivity Action: Show settings to allow configuration of quick launch shortcuts.
StringACTION_SEARCH_SETTINGSActivity Action: Show settings for global search.
StringACTION_SECURITY_SETTINGSActivity Action: Show settings to allow configuration of security and location privacy.
StringACTION_SETTINGSActivity Action: Show system settings.
StringACTION_SOUND_SETTINGSActivity Action: Show settings to allow configuration of sound and volume.
StringACTION_SYNC_SETTINGSActivity Action: Show settings to allow configuration of sync settings.
StringACTION_USER_DICTIONARY_SETTINGSActivity Action: Show settings to manage the user input dictionary.
StringACTION_WIFI_IP_SETTINGSActivity Action: Show settings to allow configuration of a static IP address for Wi-Fi.
StringACTION_WIFI_SETTINGSActivity Action: Show settings to allow configuration of Wi-Fi.
StringACTION_WIRELESS_SETTINGSActivity Action: Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.
StringAUTHORITY 
StringEXTRA_AUTHORITIESActivity Extra: Limit available options in launched activity based on the given authority.
StringEXTRA_INPUT_METHOD_ID 
以上为2012-7-12在android开发文档中截取的参数,最新参数请关注android官网的开发文档http://developer.android.com/reference/android/provider/Settings.html