Questions tagged [android-settings]

android-settings can refer to a class that contains constants values used to launch system preferences screens. For example, launch an intent to the network management screen.

android-settings
Filter by
Sorted by
Tagged with
2 votes
0 answers
80 views

Cannot read data from DATA USAGE screen of device on button click

I am opening DATA USAGE screen on button click from my application, using the following Intent:- Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.settings","com....
Kaushik Saha's user avatar
13 votes
2 answers
4k views

How to know whether Notifications are enabled or not for an application in android?

I've a ListView which has the list of installed applications and for each application, I need to know whether the notifications are enabled or not. Currently I'm using below code to know if the ...
Ashraf's user avatar
  • 143
2 votes
2 answers
3k views

How to add own setting into android system settings?

Hi I'm creating a simple app for change background but I want to put into system settings and hide from menu apps like Kidlogger Pro. I found this answer but it is only available with TTS options?
Cami Rodriguez's user avatar
1 vote
0 answers
145 views

Opening Data settings of a specific app in Settings -> Data Usage

I'm creating an app which requires Google Play services. But if the user has restricted data usage for Google Play services, the task fails if he's connected through mobile data. So as a solution I've ...
Padmal's user avatar
  • 478
5 votes
1 answer
3k views

How to pick an app to allow mock locations programmatically on Marshmallow?

Prior to Marshmallow "Allow mock locations" option could be changed programmatically(requires root) Settings.Secure.putInt(getContentResolver(),Settings.Secure.ALLOW_MOCK_LOCATION, 1); But now this ...
blackkara's user avatar
  • 4,970
7 votes
3 answers
10k views

Open specific Settings-page programmatically

Is there any way to, in my app, to redirect a user to a specific settings 'page'? My app works as a lock screen app, so I want to be able to redirect the user directly to the "Lock Screen" section of ...
Nyfiken Gul 's user avatar
13 votes
1 answer
10k views

Mistakenly selected remove from sidebar xml preview

I am using Android Studio 2.2 preview, and I have mistakenly choose Layout preview settings to remove from sidebar which appears in the left side. Now how do i get back? Its missing from sidebar. ...
Apple Appala's user avatar
0 votes
0 answers
487 views

How to enable all input methods is AOSP?

I found Preference fragment (com.android.settings.inputmethod.InputMethodAndSubtypeEnabler.java https://github.com/android/platform_packages_apps_settings/blob/master/src/com/android/settings/...
Pein's user avatar
  • 1,069
25 votes
3 answers
39k views

Access application notification settings programmatically [duplicate]

In an Android app, I have a button that I want to have the functionality of opening the App Notification settings (in Android settings). I can open the Android settings with this ...
Thought's user avatar
  • 5,676
3 votes
1 answer
1k views

Read Preferred Network Type Setting

I am trying to read the Preferred network type setting from the device. But nowhere android API's are available. Use case: Trying to read the Preferred network type and connected network type so ...
Madhukar Hebbar's user avatar
2 votes
2 answers
3k views

Android - Open up Bluetooth setting, but in another view

I know that to open up the Bluetooth settings programmatically. I do something like this: Intent intentOpenBluetoothSettings = new Intent(); intentOpenBluetoothSettings.setAction(android.provider....
Ben Wong's user avatar
  • 681
14 votes
3 answers
12k views

Change the system display size programmatically Android N

Background: Android N comes with a feature to change system Display Size from settings, in addition to the previously present feature of changing Font Size. Change Display Size: Image Source: pcmag....
Shobhit Puri's user avatar
  • 25.9k
4 votes
1 answer
737 views

How to turn off the capacitive buttons light on Samsung devices programmatically?

I need to turn off the capacitive buttons light in my app. I found this popular implementation Settings.System.putInt(getContentResolver(), "button_key_light", 0); Sadly, I get this exception on ...
Rosenpin's user avatar
  • 872
-1 votes
1 answer
189 views

Android Application Data lost when app settings changes

In my application I have saved user data in Application class. Location service is using in the app. When location permission is turned off manually from settings and go to the app , userdata saved in ...
user1767260's user avatar
  • 1,561
1 vote
1 answer
81 views

Set custom sms ringtone for single user

I want to set custom ring while receiving sms from user like "Demo" .Is it possible to set custom ring for single user ? I am trying this but can not achieve my requirement final Uri lookupUri = ...
Dinesh Rijal's user avatar
8 votes
1 answer
1k views

How to add APN in Android (KitKat and above) programmatically

I am trying to make app that makes Internet and MMS settings, if the mobile operator does not support automatic settings by sms for the current device. As it is restricted to write or read APNs from ...
Ivan Kolev's user avatar
1 vote
1 answer
1k views

Compiling the Settings app from the Android Source Code

Well I have always been puzzled by the android source code and how to compile it. By reading on stackoverflow and on other websites I have come to the idea that to compile it you have to pull the ...
Lind's user avatar
  • 277
0 votes
3 answers
169 views

How to go another page when I press settings button on action bar?

I face a problem when I try press the settings icon on action bar and go to settings page in my android project. Here is the code: public boolean onOptionsItemSelected(MenuItem item) { if(...
D.Y's user avatar
  • 55
2 votes
2 answers
1k views

Android preferences, customize EditTextPreference

I am setting up the PreferenceScreen for my Android application. I included a EditTextPreference to specify a remote server. Now I want to provide the user with an option to reset the address to the ...
Martin Jäkel's user avatar
1 vote
1 answer
5k views

How to detect/identify if device Lock Screen setting is set to None?

I need to check before enabling my application if the device has no security defined on setting. Can't have set: Pattern, PIN, Password and even Swipe. Does anyone know a way to check if the lock ...
JonasOliveira's user avatar
1 vote
1 answer
1k views

Open a Sub-Preference Screen of SettingsActivity on button click

My SettingsActivity has sub-preference screens. I want to directly open one of the nested PreferenceScreen in SettingsActivity from another Activity on button click. Basically, I want the user to be ...
BlackCursor's user avatar
  • 1,492
0 votes
3 answers
874 views

How to hide the keyboard and update EditTextPreference programmatically?

I am trying to implement the settings activity according to the guidelines. I have an EditTextPreference that I want to keep, but instead of allowing the user to type in any value, the value should ...
Apostrofix's user avatar
  • 2,140
2 votes
1 answer
9k views

How to adjust device brightness programmatically using SeekBar?

I have two seekbars in my settings application, one for sound and one for brightness. My sound seekbar does change the media volume as I want it to and it stays changed in other activities and ...
GChanna's user avatar
  • 37
1 vote
1 answer
2k views

How to open Ethernet settings programatically?

The way to open the Wi-Fi settings is the following: startActivity(new Intent(android.provider.Settings.ACTION_WIFI_IP_SETTINGS)); Is there an equivalent way for the Ethernet settings?
Hong's user avatar
  • 18.1k
-1 votes
1 answer
565 views

How can I detect action which Settings/Apps Manager is opened or not in android programmatically?

I am developing security app in android. I want that user can't uninstall and force stop my app so that can't access Application Detail Screen. But so I have used several solutions from StackOverFlow. ...
Johan Holland's user avatar
0 votes
0 answers
321 views

How to save application's preferences on server and load them

I need to load preferences from server and changes must be stored on same server. what I understood from this link is that if I use PreferenceActivity class it stores the preferences automatically in ...
Sarfraz Ahmed's user avatar
13 votes
0 answers
883 views

Toggle/Change Hidden Developer Options Settings Programmatically

I know that settings can be changed programmatically this way: Settings.Secure.putInt(getContentResolver(),Settings.Secure.ADB_ENABLED, 1); But there are some settings in Developer Options which are ...
arsena's user avatar
  • 1,955
5 votes
2 answers
3k views

How can we use espresso to test an android settings activity with an PreferenceFragment?

How can we use espresso onView and perform in a Settings activity that contains a PreferenceFragment like this: http://developer.android.com/guide/topics/ui/settings.html#Fragment
Jérôme's user avatar
  • 138
2 votes
0 answers
231 views

Can I Delete The pref_header.xml From SettingsActivity And Code in pref_general.xml

Good day, I' having a problem with the SettingActivity. The pref_header.xml is called first. And when I clicked one of them they will direct me to their pref_layout (notification, sync data) .xml . ...
RoCkDevstack's user avatar
  • 3,697
5 votes
2 answers
7k views

What Is The Difference of AppCompatPreferenceActivity And SettingActivity?

I add SettingActivity on my app, and I get this auto generated java files AppCompatPreferenceActivity.java and SettingsActivity.java . What's the difference of the two? I came across with the link ...
RoCkDevstack's user avatar
  • 3,697
52 votes
1 answer
42k views

How to open application permission window in app settings programmatically [duplicate]

I'm working on new permission model (Android 6.0 Marshmallow) and I wonder is there a way to open the application's permission window programmatically? not only application details I managed to ...
Karol Żygłowicz's user avatar
2 votes
0 answers
660 views

Allow Notification Access to Android Application without starting a android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS activity

I have created an application for accessing notifications using NotificationListenerService, but first I have to allow notification access manually to read notifications by starting another android ...
zeeali's user avatar
  • 1,594
0 votes
1 answer
109 views

Setting Button for Live Wallpapers Doesn't work

When I click Settings... in my live wallpaper I get Unfortunately, Live Wallpaper Picker has stopped This is my wallpaper XML <?xml version="1.0" encoding="UTF-8"?> <wallpaper xmlns:...
Aymen Yasser's user avatar
1 vote
0 answers
85 views

Preferences Android - Default values: XML or programmatically?

I have a field on settings where you can change the name of your device, i.e., the name that the other devices will see from that app. For the first use of this app, I would like to put on that field ...
horro's user avatar
  • 1,282
10 votes
1 answer
12k views

How to style PreferenceFragmentCompat

I'm using a PreferenceFragmentCompat, but I don't think it is styled correctly. Preferences' title seems way to big, PreferenceCategory text is unreadable, the whole think seems off. This is what I ...
David Corsalini's user avatar
2 votes
1 answer
1k views

How to display Android Settings with only one Group?

My app contains only one Settings group called "About". I generate the SettingsActivity using android studios (New> Activity> Settings Activity) and modified the files in res/xml to reduce the 3 ...
Angel Koh's user avatar
  • 13k
1 vote
0 answers
236 views

Android: Setup and manage VPNs programmatically

I would like to setup a VPN configuration and connect to it programmatically. Similar to what we can do manually at: Settings > Network connections > More networks > VPN I saw the VpnService class ...
lyc001's user avatar
  • 827
0 votes
1 answer
101 views

Why does my listPreference dialog look different?

I looked at several tutorials and all their listPreference dialogs look like this. listPreference Dialog but my dialog looks like this my dialog Any ideas why my dialog looks different? I reviewed ...
luismbedder's user avatar
0 votes
1 answer
1k views

How to force an update of the main activity from 'outside' in android?

This question is a kind of followup on this unanswered question with more and better details. Basically, I have an android main activity showing some data which are taken from a database (via ...
Alex's user avatar
  • 43.3k
-1 votes
1 answer
36 views

How do I store settings to server?

I've a fragment settings with a lot of fields regarding user profile, like height, weight, etc. Any best practice for saving that data to my server via API? When is the right moment to submit the ...
Jumpa's user avatar
  • 4,369
2 votes
1 answer
1k views

Android - How to open the default phone app screen in Marshmallow

I'm looking for a way to open the "default phone app dialog" in Marshmallow programmatically - I assume that I'm looking for the intent that should be called, something similar to android.provider....
Noa Drach's user avatar
  • 2,431
1 vote
1 answer
71 views

How do I instantly disable my done button when I switch to airplane mode?

I have a done button in my app which I would like to disable when I switch to airplane mode. I have working code for the same in my app. However, it doesn't disable as soon as I switch my app to ...
user avatar
2 votes
1 answer
952 views

How to open data roaming setting in dual sim android?

By this code: Intent i = new Intent(); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS); context.startActivity(i); I am able to open the ...
Tushar Monirul's user avatar
1 vote
4 answers
22k views

Why is "Verify apps over USB" grayed-out in Settings > Dev Options?

I'm using Android 5.0 on a new phone of mine. I'm trying to disable Verify Apps over USB (under Settings > Developer Options); I've enabled the developer options in general, but this particular ...
einpoklum's user avatar
  • 124k
-4 votes
2 answers
6k views

How to go Internet Settings in Android using code [duplicate]

I am using Webview to display some webpage , I wanted to know how to go Android Internet Setting when there is no Internet. I have provided a Button and when the user clicks on it , It should go to ...
Sudhir Belagali's user avatar
3 votes
2 answers
2k views

vibrate_when_ringing on Android Marshmallow (6.0)

In my code I have: Settings.System.putInt(this.getContentResolver(), "vibrate_when_ringing", isVibrateWhenRinging ? 1 :0); Using the following permission: <uses-permission android:name="android....
Ferran Negre's user avatar
  • 3,762
0 votes
1 answer
68 views

How to programatically create wifi connection os setting dialog

I want to design an app which shows a list of wifi networks available and it shows the wifi connection setting dialog box when it is selected. Can anyone please tell me how to do this?
siddharthan 's user avatar
9 votes
1 answer
1k views

Android app: Take user to Accessibility settings page of my app

This question is quite similar to this SO question. What I am currently using is the below code to take the user to setting page. Intent dummyIntent = new Intent(android.provider.Settings....
Sriram's user avatar
  • 9,084
1 vote
0 answers
182 views

Is there a way to show Checkbox preferences and preference header in the same preference activity?

I have a preference header file, which has a list of subscreens. Now I want to add couple of Checkbox preference in the same screen. <preference-headers xmlns:android="http://schemas.android.com/...
Ravjit Singh's user avatar
0 votes
0 answers
332 views

ClassCastException - findViewById(android.R.id.content) in Honeycomb

I have been using the following code rather successfully to support a material design PreferenceActivity, but today I got a log file from a user with a ClassCast exception. I am unable to reproduce it,...
NSouth's user avatar
  • 5,197