preference

How to set edittext preference summary and have it stick

给你一囗甜甜゛ 提交于 2021-01-27 03:39:39
问题 I have gone back and fourth on this and I just can not get it. I am setting up my settings using a preference fragment. I can get the settings to work and I can even get the "summary" to update when I make the change. But if I leave the settings screen and come back to it, the summary is back to the default text. So the question is, when using an edittext preference. How do you update the summary so it shows what the user changed the setting to and make it stick across closing the screen and

How to set edittext preference summary and have it stick

戏子无情 提交于 2021-01-27 03:37:40
问题 I have gone back and fourth on this and I just can not get it. I am setting up my settings using a preference fragment. I can get the settings to work and I can even get the "summary" to update when I make the change. But if I leave the settings screen and come back to it, the summary is back to the default text. So the question is, when using an edittext preference. How do you update the summary so it shows what the user changed the setting to and make it stick across closing the screen and

App freezes after PreferenceSwitch in settings Android Studio

谁说胖子不能爱 提交于 2020-06-09 05:22:26
问题 I made settings activity from Android Studio, not manually. I want to make a switch that applies a dark mode in the app. The problem is that when I click the switch there is no animation for movement, only a blink from the app. When I go back in my Main Activity I see that the theme is applied(I have tried earlier only with the main activity), but when I try to go back in the settings everything is frozen! Nothing can be clicked, no reaction at all. This is my Java code: import androidx

App freezes after PreferenceSwitch in settings Android Studio

强颜欢笑 提交于 2020-06-09 05:21:12
问题 I made settings activity from Android Studio, not manually. I want to make a switch that applies a dark mode in the app. The problem is that when I click the switch there is no animation for movement, only a blink from the app. When I go back in my Main Activity I see that the theme is applied(I have tried earlier only with the main activity), but when I try to go back in the settings everything is frozen! Nothing can be clicked, no reaction at all. This is my Java code: import androidx

EditTextPreference Disable Buttons?

六月ゝ 毕业季﹏ 提交于 2020-01-12 05:44:06
问题 I want to have an EditTextPreference that will disable the OK button if there is no text in the EditText field. I created a custom EditTextPreference class and I am able to get the EditText object and set a TextWatcher, but I can't find a way to disable the button. It looks like I just don't have access to the OK and Cancel buttons in the Dialog. Anyone know a way to get at these buttons or to do what I am trying to do? Only other option is to try to create from scratch a custom Dialog that

How to update summary of preference from sub-preference

馋奶兔 提交于 2020-01-06 06:01:36
问题 I can't solve this problem. I have preference screen and there is sub-preference that opens up another screen. On that another screen change of items can be caught with OnSharedPreferenceChangeListener and I change summary in parent preference screen, but when I go back to that parent preference screen, summary did not changed. Same question was asked here, but conclusion was not clear, and I could not solve this problem. It seems a common problem to me and I guess there is good solution for

Preferences of varying height within a PreferenceActivity

試著忘記壹切 提交于 2019-12-30 18:55:34
问题 I have a custom class that extends Preference that I'm using in conjunction with a PreferenceActivity. When I try to adjust the height in the layout my Preference is using (with a static layout_height or with wrap_content) it is always displayed in a uniform height cell in the Preference Activity - the same size that all of the "normal" preferences default to. Is there a way present a given preference with a different layout_height. I've looked at the API demos related to preferences and I'm

Nested Preference Screen closes on Screenorientation change in Android

て烟熏妆下的殇ゞ 提交于 2019-12-24 03:30:58
问题 I recently stumbled upon a problem. I am working with a Nested PreferenceScreen like this: <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <PreferenceScreen android:key="pref_name" android:title="@string/pref_title" > </PreferenceScreen> When my screen has the focus on the Nested Preference Screen and I change screenorientation, the Nested PreferenceScreen closes. I have also tried including: android:configChanges="orientation|keyboardHidden" in AndroidManifest

Is there a system-wide version of the Preferences API?

别来无恙 提交于 2019-12-23 13:56:08
问题 In a previous question, I learned about the preferences API. Unfortunately, it only appears to be user-specific preferences. I also have preferences that need to be able to be set across users. What is the platform-independent way to do that in Java? EDIT: Good info below, however since implementing I ran into a snag... Tested first on my dev box (Win 7, UAC off) and it works fine. Tried it on the first of my test VMs and it fails... On Win 7 with UAC on, writes fail (I can do a write

Selenium Grid 2 - Remote webdriver not setting the user agent preference in FireFox

余生长醉 提交于 2019-12-23 05:04:38
问题 I am using selenium server 2.28 on windows machine. I have set up the hub and node. I am using .net to write my test cases. I am using the following code to use custom FireFox (17.0.1) Profile with the user agent changed(to iPhone). FirefoxProfileManager profileManager = new FirefoxProfileManager(); FirefoxProfile profile = profileManager.GetProfile(FireFox_Profile_Name); profile.SetPreference("general.useragent.override", _sUserAgent); DesiredCapabilities capability = DesiredCapabilities