android-settings

How to Enable Android Download Manager

天涯浪子 提交于 2019-11-29 20:37:15
I'm using Android Download Manager to download list of files. Lately I came across a crash report saying Unknown java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads Then later, I figured it out that the reason is because user disabled Android Download Manager. I check if the Download Manager is disabled by checking it's package name with the code below. int state = this.getPackageManager().getApplicationEnabledSetting("com.android.providers.downloads"); And now, I need to find a way to enable the Download Manager if it is disabled. I tried setting it's enable state

Change the system display size programatically Android N

…衆ロ難τιáo~ 提交于 2019-11-29 19:05:10
问题 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.com Question : If an app has android.permission.WRITE_SETTINGS permission to change the settings, there are ways to change the system font size programatically as mentioned in How to programmatically change font settings of Device: font style and font size?. However I couldn't find a way to

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

早过忘川 提交于 2019-11-29 15:57:31
问题 This question already has an answer here: How to programmatically open the Permission Screen for a specific app on Android Marshmallow? 10 answers 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 open the second screen using something like this private void goToSettings() { Intent myAppSettings = new Intent(Settings.ACTION_APPLICATION_DETAILS

How Do I Disable AIRPLANE MODE tablet supports 4.4.2

笑着哭i 提交于 2019-11-29 09:00:01
I have to disable AIRPLANE MODE and DATE TIME SETTINGS in my app, for that i used these intent filters but none of them works for me <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.settings.AIRPLANE_MODE_SETTINGS" /> <category android:name="android.intent.category

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

这一生的挚爱 提交于 2019-11-28 11:40:33
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? 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. 来源: https://stackoverflow.com/questions/41105494/how-can-i-create-a-settings-button-in-androids-app-info-page

Get Device mac adress in Android Nougat and O programmatically

强颜欢笑 提交于 2019-11-28 10:10:35
问题 I have an application, which required device mac address. I'm getting mac address in Marshmallow and below easily but problem with android nougat and O. So how to find mac. 回答1: Changed since 6.0 and later: https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and

How to style PreferenceFragmentCompat

假装没事ソ 提交于 2019-11-28 08:40:45
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="preferenceFragmentStyle">@style/PreferenceFragment</item> <item name="preferenceCategoryStyle">@style

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

北城余情 提交于 2019-11-28 04:46:09
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 GPS feature is needed. Upon the user's selection "OK" GPS will be enabled directly without any

How Do I Disable AIRPLANE MODE tablet supports 4.4.2

陌路散爱 提交于 2019-11-28 02:21:48
问题 I have to disable AIRPLANE MODE and DATE TIME SETTINGS in my app, for that i used these intent filters but none of them works for me <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android

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

两盒软妹~` 提交于 2019-11-27 20:38:33
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 maximumBytes are NULL And TrafficStats class just have a data transferred not the limits. Marcelo Filho