preferences

View an Android App's shared preferences?

你。 提交于 2019-12-09 04:37:45
问题 When I am working on my app in eclipse, is there a way to see the changes I make to the shared preferences of the app while it is debugging in the emulator? Thanks in advance 回答1: Run project in emulator, then from Eclipse choose menu Windows-> open perspective ->DDMS. From tab device, choose emulator name, then go to file explorer,expand data->data->yourpackagename, you should see share reference xml file ( only work on the emulator or a rooted device ). Finally, export this file to windows.

Java String initialization

久未见 提交于 2019-12-08 15:26:53
问题 Which do you prefer and why" String myString = null; if(someCondition) myString = "something"; else myString = "something else"; OR String myString = ""; if(someCondition) myString = "something"; else myString = "something else"; I know that using the ternary (? :) operator is possible but I'd like to know about the above two. 回答1: Neither. Instead, this: String myString; if (someCondition) myString = "something"; else myString = "something else"; In both of your alternatives, the variable is

AIR 2 - Data Persistence?

半腔热情 提交于 2019-12-08 12:35:16
问题 what is the best way to include data persistence in an AIR 2 application? is it creating your own read/write file with flash.filesystem, or is there a new way with AIR 2? 回答1: it seems that adobe wrote a library for saving preferences in AIR years ago, but have never added it to the official library? now i'm curious why they would not have done so, since data persistance is key for desktop applications. adobe's AIR Preferences library ("as3preferenceslib"), consisting of 3 classes, can be

Empty PreferenceActivity though a PreferenceFragment was added

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 11:17:11
问题 I'm stuck with a pretty simple issue: I'm trying to build a Preference screen in my app and I'd like to do it with the new, now-standard PreferenceFragment method. This is my prefs xml: <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="@string/prefs_interface_settings"> <SwitchPreference android:key="show_average" android:title="Show average length of work day" android:defaultValue="false" android:summary="Display the calculated

iPhone - reading and saving preferences [closed]

喜欢而已 提交于 2019-12-08 09:54:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I've read the Apple doc about Preferences but this is still a little bit complex for me to understand. I have an application with a

android EditText in preference screen

风格不统一 提交于 2019-12-08 08:50:04
问题 Can I put an EditText element in a preference screen? I want to do this to allow fast searching of a large ListPreference by typing, but do not want to save the contents of the search box? Is this possible, or are standard layout controls not allowed on preference screens. The goal is to provide a means of selecting a time-zone and saving it as a preference. Using a ListViewPrefernce alone isn't sufficient because of the huge amount of time-zones that must be scrolled though. Hence, I would

Reacting to a click on a preference

↘锁芯ラ 提交于 2019-12-08 08:16:19
问题 I have a simple preference (not EditText preference or ListPreference). I have a method that deletes all files in a directory. I want to do this when user clicks on a preference, but i don't know how to react to a click on a preference. 回答1: getPreferenceManager().findPreference("pref_key").setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { // Do stuff here } }); 回答2: if your preference is stored in an object(

Disable sound just for one application

删除回忆录丶 提交于 2019-12-08 08:07:55
问题 Is it possible to turn off all sounds of just one app and to save the choice until the next start of the app? So I have a ToggleButton at the StartActivity and by pressing this Button, all sounds of the app should be deactivated, but sounds of other apps should still be working. I tried it with Preferences, using the SharedPreferences class, an xml file and so on, like in my book. But going through the introduction i realized, that the Preferences are just a way to save data permanent. So I

How to create a hyperlink in Eclipse plugin preferences page?

感情迁移 提交于 2019-12-08 07:53:17
问题 I have an Eclipse plugin with a description and three text fields. However, I would like to add a group of three radio buttons that perform specific actions on changing the selected choice. I would also like to have a hyperlink to an information page where people can click it and be directed to their browser for viewing the information. The library org.eclipse.jface.preference does not seem to contain such classes and functions. Would it be possible to guide me to the appropriate resources or

Android switching between PreferenceScreens

时光总嘲笑我的痴心妄想 提交于 2019-12-08 04:58:45
问题 I have a PreferencesScreen, that has some Preferences and a sub-screen. It looks like this: <PreferenceScreen android:key="root"> <Preference android:key="first" /> <PreferenceScreen android:key="subScreen" /> <Preference android:key="second" /> <Preference android:key="third" /> </PreferenceScreen> </PreferenceScreen> When user clicks the subscreen, he is moved to the subscreen view. Now I want to redirect the user to "root" preference screen when he clicks on "second" or "third". I don't