Open setting app android

How to open Android Settings programmatically with Java

Carlos Delgado

Learn how to open dinamically the settings of Android in your app easily

In case your app needs that your user make some changes in the Settings menu i.e to set a default app to open a specific type of files etc, you may like to make this task easier for your user by starting the Settings menu of Android dinamically from your app.

Show system settings

To display the Settings page programmatically, you can use the startActivityForResult method with an Intent object and a constant of the Settings, the following example should open the general settings menu of Android:

The usage of the ACTION_SETTINGS constant with startActivityForResult will show system settings. The Settings provider contains global system-level device preferences.

Access specific settings areas

The following list contains all the constants that provide access to different areas of the settings menu:

Note: not all the constants are available on every Android version. In case you need more information visit the official documentation here.

Constants of android.provider.Settings

Activity Action: Show settings for accessibility modules.

Activity Action: Show add account screen for creating a new account.

Activity Action: Show settings to allow entering/exiting airplane mode.

Activity Action: Show settings to allow configuration of APNs.

Activity Action: Show screen of details about a particular application.

Activity Action: Show settings to allow configuration of application development-related settings.

Activity Action: Show settings to allow configuration of application-related settings.

Activity Action: Show battery saver settings.

Activity Action: Show settings to allow configuration of Bluetooth.

Activity Action: Show settings for video captioning.

Activity Action: Show settings to allow configuration of cast endpoints.

Activity Action: Show settings for selection of 2G/3G.

Activity Action: Show settings to allow configuration of date and time.

Activity Action: Show general device information settings (serial number, software version, phone number, etc.).

Activity Action: Show settings to allow configuration of display.

Activity Action: Show Daydream settings.

Activity Action: Show settings to configure the hardware keyboard.

Activity Action: Show Home selection settings.

Activity Action: Show screen for controlling background data restrictions for a particular application.

Activity Action: Show screen for controlling which apps can ignore battery optimizations.

Activity Action: Show settings to configure input methods, in particular allowing the user to enable input methods.

Activity Action: Show settings to enable/disable input method subtypes.

Activity Action: Show settings for internal storage.

Activity Action: Show settings to allow configuration of locale.

Activity Action: Show settings to allow configuration of current location sources.

Activity Action: Show settings to manage all applications.

Activity Action: Show settings to manage installed applications.

Activity Action: Show Default apps settings.

Activity Action: Show screen for controlling which apps can draw on top of other apps.

Activity Action: Show screen for controlling which apps are allowed to write/modify system settings.

Читайте также:  Kogama android parkour 60 levels

Activity Action: Show settings for memory card storage.

Activity Action: Show settings for selecting the network operator.

Activity Action: Show NFC Sharing settings.

Activity Action: Show NFC Tap & Pay settings

This shows UI that allows the user to configure Tap&Pay settings.

Activity Action: Show NFC settings.

Activity Action: Show Notification listener settings.

Activity Action: Show Do Not Disturb access settings.

Activity Action: Show the top level print settings.

Activity Action: Show settings to allow configuration of privacy options.

Activity Action: Show settings to allow configuration of quick launch shortcuts.

Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, put them on the whitelist of apps shown by ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS ).

Activity Action: Show settings for global search.

Activity Action: Show settings to allow configuration of security and location privacy.

Activity Action: Show system settings.

Activity Action: Show the regulatory information screen for the device.

Activity Action: Show settings to allow configuration of sound and volume.

Activity Action: Show settings to allow configuration of sync settings.

Activity Action: Show settings to control access to usage information.

Activity Action: Show settings to manage the user input dictionary.

Activity Action: Modify Airplane mode settings using a voice command.

Activity Action: Modify Battery Saver mode setting using a voice command.

Activity Action: Modify do not disturb mode settings.

Activity Action: Show settings to configure input methods, in particular allowing the user to enable input methods.

Activity Action: Show settings to allow configuration of VPN.

Activity Action: Show VR listener settings.

Activity Action: Allows user to select current webview implementation.

Activity Action: Show settings to allow configuration of a static IP address for Wi-Fi.

Activity Action: Show settings to allow configuration of Wi-Fi.

Activity Action: Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.

Activity Extra: Limit available options in launched activity based on the given account types.

Activity Extra: Enable or disable Airplane Mode.

Activity Extra: Limit available options in launched activity based on the given authority.

Activity Extra: Enable or disable Battery saver mode.

Activity Extra: Enable or disable Do Not Disturb mode.

Activity Extra: How many minutes to enable do not disturb mode for.

Activity Category: Show application settings related to usage access.

Metadata key: Reason for needing usage access.

For example, you can open directly the Language Settings of the device (to change language) executing:

With the introduction of new Android APIs, there will be more settings available areas with different constants, read the official documentation of android provider settings here.

Add the permissions if required

For some special areas of the Android Settings, you will need permissions. For example, to open the bluetooth settings you’ll need to add the following bluetooth permissions in your app manifest:

And then you’ll be able to open the bluetooth settings:

Otherwise you’ll get the following exception:

Источник

How can I programmatically open the permission screen for a specific app on Android 6.0 (Marshmallow)?

I have a question regarding the new Android 6.0 (Marshmallow) release:

Is it achievable to display the permission screen for a specific app via an Intent or something similar?

Читайте также:  Сколько версий андроида существует

It’s possible to display the app settings with the following code — is there an analog solution for directly opening the permission screen?

I already did some research on this, but I wasn’t able to find a proper solution.

14 Answers 14

According to the official Marshmallow permissions video (at the 4m 43s mark), you must open the application Settings page instead (from there it is one click to the Permissions page).

To open the settings page, you would do

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can’t declare.

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

As I don’t want to have this in my history stack I remove it using intent flags.

Источник

Opening Android Settings programmatically

How can I open settings programmatically?

12 Answers 12

You can open with

You can return by pressing back button on device.

This did it for me

When they press back it goes back to my app.

I used the code from the most upvoted answer:

It opens the device settings in the same window, thus got the users of my android application (finnmglas/Launcher) for android stuck in there.

The answer for 2020 and beyond (in Kotlin):

It works in my app, should also be working in yours without any unwanted consequences.

You can try to call:

for other screen in setting screen, you can go to

Hope help you in this case.

In general, you use the predefined constant Settings.ACTION__SETTINGS . The full list can be found here

In case anyone finds this question and you want to open up settings for your specific application:

To achieve this just use an Intent using the constant ACTION_SETTINGS, specifically defined to show the System Settings:

startActivityForResult() is optional, only if you want to return some data when the settings activity is closed.

here you can find a list of contants to show specific settings or details of an aplication.

Источник

How to change default apps in Android

It’s a problem you might run into regularly. You tap a file that you really want to open with a particular app, but for some reason, Android keeps opening it with some application you couldn’t care less about. That’s because you’ve got the wrong app selected for that type of file. You’re in the right place, however. In this brief guide, we’ll walk you through the process of changing default apps on Android.

Editor’s note: These instructions were put together using a Pixel 4a running stock Android 11. It’s a great device to base any guide on but some steps might be different, depending on the device and software you use.

How to manage default apps

The process used to be much more complicated, but Google has turned managing default apps into an effortless task. It’s baked right into the settings. Just go into your Settings app, select Apps & notifications, click on Advanced, and then go into Default apps.

From there, you can pick your default browser, call redirecting, caller ID, digital assistant, home launcher, phone, and SMS default applications. You can also go into Opening links to edit individual apps on your phone.

Читайте также:  Перенести контакты андроид через gmail

Step-by-step instructions to manage default apps:

  1. Open the Settings app on your Android phone.
  2. Go into Apps & notifications.
  3. Hit Advanced.
  4. Select Default apps.
  5. Pick the apps you want for each option.

Manage defaults as you go

The Android operating system uses a pretty slick concept called “implicit intent.” Basically, if the user or an app calls for the device to do something like “take a picture,” the operating system will look for an app that can get the job done. If more than one option exists, and no default has been selected (or if a new possibility has been installed since the last time a default was set), then Android will ask the user which app they would prefer to use. This makes the process of setting default apps easy and intuitive.

Next time you open any link or action, and Android gives you options for which app to use, select your preferred default app. You can now select Just once or Always. Select Always if you want to make that app the default one. The operating will remember your preference from then on.

The only issue with doing this is that sometimes people accidentally set a default app they didn’t intend to. You can follow the steps in the previous section to change your preference. Once you get to the Default apps section, go into Opening links. Find the app you want to change your preferences for and go into it. You’ll get all the options you need there.

Step-by-step instructions to manage defaults as you go:

  1. Open a link to a website or action you want to set a default app for. I’m using BestBuy as an example.
  2. Android will ask you which app you want to use.
  3. You can pick to use this app Just Once or Always.
  4. Pick Always to set it as the preferred method.

Nuclear option: Reset all default apps

If you can’t quite figure out which app default is giving you fits and the option to choose a new default isn’t appearing no matter what you do, there’s still hope!

However, bear in mind that going through with this procedure will also enable all disabled apps, reset any app notification options, remove any background data restrictions or permission restrictions placed on specific apps. You won’t lose any data, but if you play around with your apps’ settings a lot, you might have to do a fair amount of reconfiguring to get things back to how you like them.

If you’re ready for an app settings reset, go into your Settings app. Select Apps & notifications, and tap on See all apps. Hit the three-dot menu button in the top-right corner. Tap on Reset app preferences. Confirm by tapping on Reset apps.

Step-by-step instructions to reset default apps:

  1. Open the Settings app on your Android phone.
  2. Go into Apps & notifications.
  3. Tap on the See all apps option.
  4. Hit the three-dot menu button.
  5. Tap on Reset app preferences.
  6. Confirm by selecting Reset apps.

Источник

Оцените статью