Android Development How to quickly invoke system settings

Source: Internet
Author: User

Before, we typically call system settings (Time settings, network settings, and so on) in the following way:

1 New Intent (); 2 New ComponentName ("Com.android.settings",3         "com.android.settings.WirelessSettings"); 4 Intent.setcomponent (CN); 5 intent.setaction ("Android.intent.action.VIEW"); 6 startactivity (intent);

However, after testing, the use of the SDK4.0 version will throw an exception, then we can use the following way to invoke the System Setup interface:

  New Intent (Android.provider.Settings.ACTION_WIRELESS_SETTINGS);  StartActivity (Intent);

Using the fields below, you can open the appropriate system Setup interface in your software:

Android.provider.Settings.ACTION_SETTINGS //System settings

Android.provider.Settings.ACTION_APN_SETTINGS //access point settings

Android.provider.Settings.ACTION_SOUND_SETTINGS //Sound Settings

Android.provider.Settings.ACTION_WIRELESS_SETTINGS //Network Settings

Android.provider.Settings.ACTION_SECURITY_SETTINGS //Security Settings

Android.provider.Settings.ACTION_WIFI_SETTINGS //wifi Settings

Android.provider.Settings.ACTION_BLUETOOTH_SETTINGS //Bluetooth settings

Android.provider.Settings.ACTION_DATE_SETTINGS //Date and time settings

Android.provider.Settings.ACTION_BLUETOOTH_SETTINGS //Bluetooth settings

Here is only a list of commonly used fields, the other can be found in the official source code, is not very simple?!

Android Development How to quickly invoke system settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.