preference

Getting value from custom SeekBarPreference

你。 提交于 2019-12-12 18:12:09
问题 I found this code on internet and thought I would give it a try. I put it in my preferences and it was exaclt the way I wanted it to be but my only problem is that I cant get the value of SeekBar. Here is the link to code that I am using in my preference: http://android.hlidskialf.com/blog/code/android-seekbar-preference and here is the part of preference xml: <com.mypack.SeekBarPreference android:key="zoom" android:title="Zoom" android:summary="" android:dialogMessage="Zoom level" android

android preference horizontal divider in custom preference?

丶灬走出姿态 提交于 2019-12-12 11:08:56
问题 I've created my own custom preference objects that extend Preference. I've only created them because there are no Preferences for these custom data types. Everything is working, but my custom preferences don't have the same appearance because they are missing the horizontal divider that the system preference objects have. I've looked for the code that is creating the horizontal divider, but I can't find where it is done. The built in divider isn't just a thin bar. There is a bit of a gradient

Setting preference layout and changing the attribute in it

笑着哭i 提交于 2019-12-12 08:42:53
问题 is it possible to access programmatically a layout which is set to a Preference? Here is what I have, a very simple project - proof of concept The Preference Activity: package com.example; import android.os.Bundle; import android.preference.PreferenceActivity; import android.util.Log; import android.view.View; public class PreferenceExampleActivity extends PreferenceActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super

Allow JavaScript from Apple Events in Safari through Terminal Mac

放肆的年华 提交于 2019-12-12 08:25:00
问题 I'm writing a program that executes do javascript in Safari. The only problem is that I'm trying to make the app give its self permission to do it. I'm trying to locate the file that handles the Safari developer preferences so that I can do this. Does anyone have any idea where this might be or how to change these settings? 回答1: It's in Safari's preferences plist at ~/Library/Preferences/com.apple.Safari.plist . The key you want is AllowJavaScriptFromAppleEvents . You can set it using

implementing multi-process shared DB in macOS using XPC

自古美人都是妖i 提交于 2019-12-11 15:19:59
问题 My Goal is to develop robust, coherent, and persistent DB that can be shared between processes, just list Windows Registry. On a previous question I advised not to use CFPreferences (and NSUserDefaults) due to the following reason Current versions of macOS have a great deal of difficulty, and sometimes outright refuse, to update the values in one process with the values set by a second process. Alternatively, I advised to use the following approach: To have one process responsible for all of

How to make a Preference not save to SharedPreferences?

别等时光非礼了梦想. 提交于 2019-12-11 06:48:56
问题 I am re-using ListPreference for a setting which I store only in the database. How can I prevent it from storing/persisting any data to the preference file? 回答1: Subclass it, override shouldPersist() to return false. 回答2: I've not done it myself, but have you looked into overriding onDialogClosed() ? 来源: https://stackoverflow.com/questions/2488830/how-to-make-a-preference-not-save-to-sharedpreferences

Preference Menu on 10 inch tablet

纵然是瞬间 提交于 2019-12-10 22:14:25
问题 I am trying to figure out why the layout of my Preference menu is displayed in a false way on 10' tablets when using it in landscape mode. It looks like the lines that are to the right of the Checkboxes are actually to the left of them. You can see this here http://imageshack.us/photo/my-images/109/schnappschuss2013052109.png/ On 7' tablets, everything works like expected to do. My menu looks like that: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas

RingtonePreference doesn't save its value

痞子三分冷 提交于 2019-12-10 17:46:55
问题 I already worked with some preferences, such as EditTextPreference , etc, and all they work, but now I need to use RingtonePreference , and it does not work properly. Here's very simple code: <RingtonePreference android:key="my_ringtone_key" android:title="Select ringtone" /> When I click on this preference, id does open dialog to select ringtone, but it does not save it . I mean, I select ringtone, press "ok", then click this preference again, and still no ringtone selected. If I try to get

Difference between android:widgetLayout and android:layout for preference?

ぃ、小莉子 提交于 2019-12-10 17:29:27
问题 I'm getting some weird configuration where widgetLayout configures the inner space of a list item and layout configures the whole item list and the screen background? Can someone actually explain what is the widgetLayout? 回答1: android:layout : The layout for the entire Preference (include title, summary and widget) android:widgetLayout : The layout for the controllable widget portion of a Preference (e.g. a checkbox preference would specify a custom layout consisting of just the CheckBox here

Pass reference of one Activity to another Activity

和自甴很熟 提交于 2019-12-10 16:03:10
问题 I know that I can pass some values between Activities using intent. However, if I want to pass whole Activity to another Activity I think it is not good approach. Is there another way to do that? I have Settings Activity in which I am changing some Colors. So after I come back to my Main Activity I would like to apply those colors. To do this, I need access to MainActivity fields after I change Color value, so inside PreferenceActivity. In other words, I want to have access to Main activity