最近做的一个功能是点击一个按钮进入系统的时间设置页面,可是我想啊,那个页面肯定是个activity,而不同的系统有着不同的页面,或者说activity的类名可能不一样,那我进入时岂不是要做很多判断?
刚刚查了资料发现方法如下:
mContext.startActivity(new Intent(Settings.ACTION_DATE_SETTINGS));
启动的是一个action,那么系统会自动判断会被哪个activity接收!
其他设置页面对应的action:(来自 http://www.cnblogs.com/jiayonghua/archive/2012/05/07/2487582.html)
String | ACTION_ACCESSIBILITY_SETTINGS | Activity Action: Show settings for accessibility modules. |
String | ACTION_ADD_ACCOUNT | Activity Action: Show add account screen for creating a new account. |
String | ACTION_AIRPLANE_MODE_SETTINGS | Activity Action: Show settings to allow entering/exiting airplane mode. |
String | ACTION_APN_SETTINGS | Activity Action: Show settings to allow configuration of APNs. |
String | ACTION_APPLICATION_DETAILS_SETTINGS | Activity Action: Show screen of details about a particular application. |
String | ACTION_APPLICATION_DEVELOPMENT_SETTINGS | Activity Action: Show settings to allow configuration of application development-related settings. |
String | ACTION_APPLICATION_SETTINGS | Activity Action: Show settings to allow configuration of application-related settings. |
String | ACTION_BLUETOOTH_SETTINGS | Activity Action: Show settings to allow configuration of Bluetooth. |
String | ACTION_DATA_ROAMING_SETTINGS | Activity Action: Show settings for selection of2G/3G. |
String | ACTION_DATE_SETTINGS | Activity Action: Show settings to allow configuration of date and time. |
String | ACTION_DEVICE_INFO_SETTINGS | Activity Action: Show general device information settings (serial number, software version, phone number, etc.). |
String | ACTION_DISPLAY_SETTINGS | Activity Action: Show settings to allow configuration of display. |
String | ACTION_INPUT_METHOD_SETTINGS | Activity Action: Show settings to configure input methods, in particular allowing the user to enable input methods. |
String | ACTION_INPUT_METHOD_SUBTYPE_SETTINGS | Activity Action: Show settings to enable/disable input method subtypes. |
String | ACTION_INTERNAL_STORAGE_SETTINGS | Activity Action: Show settings for internal storage. |
String | ACTION_LOCALE_SETTINGS | Activity Action: Show settings to allow configuration of locale. |
String | ACTION_LOCATION_SOURCE_SETTINGS | Activity Action: Show settings to allow configuration of current location sources. |
String | ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS | Activity Action: Show settings to manage all applications. |
String | ACTION_MANAGE_APPLICATIONS_SETTINGS | Activity Action: Show settings to manage installed applications. |
String | ACTION_MEMORY_CARD_SETTINGS | Activity Action: Show settings for memory card storage. |
String | ACTION_NETWORK_OPERATOR_SETTINGS | Activity Action: Show settings for selecting the network operator. |
String | ACTION_PRIVACY_SETTINGS | Activity Action: Show settings to allow configuration of privacy options. |
String | ACTION_QUICK_LAUNCH_SETTINGS | Activity Action: Show settings to allow configuration of quick launch shortcuts. |
String | ACTION_SEARCH_SETTINGS | Activity Action: Show settings for global search. |
String | ACTION_SECURITY_SETTINGS | Activity Action: Show settings to allow configuration of security and location privacy. |
String | ACTION_SETTINGS | Activity Action: Show system settings. |
String | ACTION_SOUND_SETTINGS | Activity Action: Show settings to allow configuration of sound and volume. |
String | ACTION_SYNC_SETTINGS | Activity Action: Show settings to allow configuration of sync settings. |
String | ACTION_USER_DICTIONARY_SETTINGS | Activity Action: Show settings to manage the user input dictionary. |
String | ACTION_WIFI_IP_SETTINGS | Activity Action: Show settings to allow configuration of a static IP address for Wi-Fi. |
String | ACTION_WIFI_SETTINGS | Activity Action: Show settings to allow configuration of Wi-Fi. |
String | ACTION_WIRELESS_SETTINGS | Activity Action: Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks. |
String | AUTHORITY |
|
String | EXTRA_AUTHORITIES | Activity Extra: Limit available options in launched activity based on the given authority. |
String | EXTRA_INPUT_METHOD_ID |