android-settings

How can I create a settings button in Android's app info page?

浪子不回头ぞ 提交于 2019-11-27 06:22:43
问题 Nova Launcher opens their settings with the cogwheel in the upper right. How is this done? How would I place my app's settings activity there? 回答1: On Android 7.0 and higher, you can use this <intent-filter> on your settings activity: <intent-filter> <action android:name="android.intent.action.APPLICATION_PREFERENCES" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> The Settings app should pick that up and make it available to the user via that gear icon. 来源:

How to style PreferenceFragmentCompat

混江龙づ霸主 提交于 2019-11-27 02:21:49
问题 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 have in theme.xml <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> ... <item name="preferenceTheme">@style/PreferenceThemeOverlay</item> </style> <style name="PreferenceThemeOverlay"> <item name="preferenceScreenStyle">@style/Preference.PreferenceScreen</item> <item name=

Android: Can I enable the GPS without redirecting the user to the settings screen like in “google maps” app

烂漫一生 提交于 2019-11-27 00:38:52
问题 In GPS based applications, it is important that the user enable his GPS. If not then usually we would show a dialog stating that the user " should enable his GPS from the settings to be able to use this functionality ". When the user press OK he will be redirected to the Settings page, I don't like this solution since it takes the user out of the application context in to the settings. I have noticed that "google maps" application has a better solution, which is to show a neat dialog when a

How to get programmatically the data usage limit set by user on Android OS configuration?

笑着哭i 提交于 2019-11-26 22:53:58
问题 User can define at Data Usage screen a limite and/or a warning limit for mobile data usage. So how can I get this information by code? Screen of Data Usage configuration of native OS. I wanna the limit value and warning value. I've already tried this but not work and always return NULL to both: final Long recommendedBytes = DownloadManager.getRecommendedMaxBytesOverMobile( this.context ); final Long maximumBytes = DownloadManager.getMaxBytesOverMobile( this.context ); // recommendedBytes and

Opening Android Settings programmatically

大城市里の小女人 提交于 2019-11-26 18:30:51
How can I open settings programmatically? You can open with startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); You can return by pressing back button on device. This did it for me Intent callGPSSettingIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(callGPSSettingIntent); When they press back it goes back to my app. Cafe Không Đường You can try to call: startActivityForResult(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS)); for other screen in setting screen, you can go to https://developer.android

Go to settings screen

前提是你 提交于 2019-11-26 18:11:18
问题 I want to open the Settings-> Sound & Display-> Phone Ringtones screen from my application. How can I do that? 回答1: Depending on your needs, there are a couple of alternatives to bring up the 'Ringtones' settings screen from your application. If you want to bring up the actual preferences screen that is usually available through system settings -- letting your user modify the phone's universal ringtone settings through your application -- you can use the ACTION_SOUND_SETTINGS constant from

Enabling Location mode High Accuracy or Battery saving, programmatically, without user needing to visit Settings

倖福魔咒の 提交于 2019-11-26 17:21:13
Why i ask this: (also the reason for trying it in an app) It happens when we use Google Maps in Lollipop . Even if the Location is disabled, it is turned on, in high accuracy mode after user's input from the Maps app, without having to visit Settings. A similar functionality can be achieved for enabling Bluetooth, where the action is initiated in my app; user needs to make a choice but user is not redirected to Settings, using: startActivity(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)); which could be found on BluetoothAdapter , now we know there is no LocationAdapter, so i looked

Opening Android Settings programmatically

我怕爱的太早我们不能终老 提交于 2019-11-26 06:28:02
问题 How can I open settings programmatically? 回答1: You can open with startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); You can return by pressing back button on device. 回答2: This did it for me Intent callGPSSettingIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(callGPSSettingIntent); When they press back it goes back to my app. 回答3: You can try to call: startActivityForResult(new Intent(android.provider

Enabling Location mode High Accuracy or Battery saving, programmatically, without user needing to visit Settings

旧巷老猫 提交于 2019-11-26 05:24:00
问题 Why i ask this: (also the reason for trying it in an app) It happens when we use Google Maps in Lollipop . Even if the Location is disabled, it is turned on, in high accuracy mode after user\'s input from the Maps app, without having to visit Settings. A similar functionality can be achieved for enabling Bluetooth, where the action is initiated in my app; user needs to make a choice but user is not redirected to Settings, using: startActivity(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)