Search Results

Search found 1560 results on 63 pages for 'preferences'.

Page 1/63 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Android Preferences: How to load the default values when the user hasn't used the preferences-screen

    - by Peterdk
    I am using a PreferenceActivity to let the user set some values. I am feeding it the xml file with the defined preferences. I have set all the android:defaultValue="" for them. When I start my application, I need the preferences, or if they are not set yet manually, I want the default values: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean value = prefs.getBoolean("key"), false); However, when android:defaultValue="true" I still get false. So, it looks like the defaultValues set in the XML are not used anywhere but when initializing the preferences-screen. I don't want to hardcode the default values in the getBoolean() method. So, is there a way get the default-values with only defining these in 1 place?

    Read the article

  • Reinstalled Ubuntu 12.04 and now I cannot change preferences like theme, wallpaper, and nautilus preferences

    - by krishnab
    So I just down-rev'd ubuntu from 13.04 back to 12.04 LTS desktop 64 (Precise). I am using Unity. I just reformatted the Ubuntu partition, but kept my home directory intact, and everything seemed to reconnect just fine. No data was lost. However, I found that I cannot seem to change my preferences. So I cannot seem to change my desktop background, no matter how many ways I try--Ubuntu Tweak, Gnome Tweak, system settings. I also cannot change the system GTK+ theme, though apparently I am able to change the windows border theme. Further, I cannot seem to change my Nautilus preferences--so I cannot seem the make the default view a list view, and I cannot make the "single-click" behavior the default. I even went into the nautilus org.gnome.nautilus settings to manually change things, but no luck. I thought it was a permissions issue, so I did a chown on the home folder and on the .gvfs folder. Still no luck. So somewhere there seems to be a permission that I am not catching. Does anyone have any suggestions? Thanks.

    Read the article

  • Force close message when preferences are called via menu button

    - by Dan T
    I see no problem in the code. Help? preferences.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <ListPreference android:title="Gender" android:summary="Are you male or female?" android:key="genderPref" android:defaultValue="male" android:entries="@array/genderArray" android:entryValues="@array/genderValues" /> <ListPreference android:title="Weight" android:summary="How much do you weigh?" android:key="weightPref" android:defaultValue="180" android:entries="@array/weightArray" android:entryValues="@array/weightValues" /> </PreferenceScreen> arrays.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="genderArray"> <item>Male</item> <item>Female</item> </string-array> <string-array name="genderValues"> <item>male</item> <item>female</item> </string-array> <string-array name="weightArray"> <item>120</item> <item>150</item> <item>180</item> <item>210</item> <item>240</item> <item>270</item> </string-array> <string-array name="weightValues"> <item>120</item> <item>150</item> <item>180</item> <item>210</item> <item>240</item> <item>270</item> </string-array> </resources> Preferences.java: package com.dantoth.drinkingbuddy; import android.os.Bundle; import android.preference.PreferenceActivity; public class Preferences extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); }; } butts.xml (idk why it's butts but I've gotten used to it now. really just sets up the menu button) <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/settings" android:title="Settings" android:icon="@drawable/ic_menu_settings" /> <item android:id="@+id/archive" android:title="Archive" android:icon="@drawable/ic_menu_archive" /> <item android:id="@+id/new_session" android:title="New Session" android:icon="@drawable/ic_menu_new" /> <item android:id="@+id/about" android:title="About" android:icon="@drawable/ic_menu_about" /> </menu> within DrinkingBuddy.java: @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: startActivity(new Intent(this, Preferences.class)); return true; case R.id.archive: Toast.makeText(this, "Expect to see your old drinking sessions here.", Toast.LENGTH_LONG).show(); return true; //ETC. } return false; That's it. I can press the menu button on the phone and see the menu items I created, but when I click on the "Settings" (r.id.settings) it FC. Do I have to do anything to the manifest/other thing to get this to work??

    Read the article

  • AMD control center doesn't save preferences

    - by Fault
    Everytime when I edit the monitor preferences in AMD to multi-monitor or to a multidesktop, when I press save or apply the program just closes with no errors and the preferences hasn't been saved. If I try to do it via the Displays app that is built-in in ubuntu 11.10 I get the following error: The selected configuration for displays could not be applied required virtual size does not fit available size: requested=(2560, 1024), minimum=(320, 200), maximum=(1280, 1280) I don't know if it helps but my graphics card is a ATI Radeon HD 4800 and my monitors are both 1280x1024. I'm running the proprietary driver without post-release updates because I always get an error trying to install that one.

    Read the article

  • Get preferences in AppWidget Provider

    - by Brian515
    Hi all, I seem to be having trouble reading preferences from my AppWidgetProvider class. My code works in an Activity, but it does not in an AppWidgetProvider. Here is the code I am using to read back a boolean: SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); boolean autoreplyon = settings.getBoolean("autoreplyon", false); However, I get the "The method getSharedPreferences(String, int) is undefined for the type widget" error (widget is the name of my AppWidgetProvider class). Thanks in advance for any suggestions!

    Read the article

  • Initialize preferences from XML in main Activity

    - by pixel
    My problem is that when I start application and user didn't open my PreferenceActivity so when I retrieve them don't get any default values defined in my preference.xml file. preference.xml file: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="applicationPreference" android:title="@string/config" > <ListPreference android:key="pref1" android:defaultValue="default" android:title="Title" android:summary="Summary" android:entries="@array/entry_names" android:entryValues="@array/entry_values" android:dialogTitle="@string/dialog_title" /> </PreferenceScreen> Snippet from my main Activity (onCreate method): SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this); String pref1 = appPreferences.getString("pref1", null); In result I end up with a null value.

    Read the article

  • Account Preferences Crashes

    - by Vivek Sundaram
    When I click on System Preferences Accounts, I get a crash [every single time]. Here are a few interesting snippets from the "Problem Report". Any ideas on how to tackle this? Process: System Preferences [607] Path: /Applications/System Preferences.app/Contents/MacOS/System Preferences Identifier: com.apple.systempreferences Version: 7.0 (7.0) Build Info: SystemPrefsApp-1750100~5 Code Type: X86-64 (Native) Parent Process: launchd [184] OS Version: Mac OS X 10.6.5 (10H574) Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000117547860 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: objc_msgSend() selector name: willSelect objc[607]: garbage collection is ON Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x00007fff80fd211c objc_msgSend + 40 1 com.apple.systempreferences 0x0000000100008426 0x100000000 + 33830 2 com.apple.systempreferences 0x0000000100006fb8 0x100000000 + 28600 3 com.apple.Foundation 0x00007fff84ede23c __NSFireDelayedPerform + 404 4 com.apple.CoreFoundation 0x00007fff824acbe8 __CFRunLoopRun + 6488 5 com.apple.CoreFoundation 0x00007fff824aadbf CFRunLoopRunSpecific + 575 6 com.apple.HIToolbox 0x00007fff82ec691a RunCurrentEventLoopInMode + 333 7 com.apple.HIToolbox 0x00007fff82ec671f ReceiveNextEventCommon + 310 8 com.apple.HIToolbox 0x00007fff82ec65d8 BlockUntilNextEventMatchingListInMode + 59 9 com.apple.AppKit 0x00007fff866c0e64 _DPSNextEvent + 718 10 com.apple.AppKit 0x00007fff866c07a9 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155 11 com.apple.AppKit 0x00007fff8668648b -[NSApplication run] + 395 12 com.apple.AppKit 0x00007fff8667f1a8 NSApplicationMain + 364 13 com.apple.systempreferences 0x0000000100001cf4 0x100000000 + 7412 ... Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000001 rbx: 0x0000000200037840 rcx: 0x0000000200058031 rdx: 0x00007fff5fbfe2c0 ... Binary Images: 0x100000000 - 0x10001eff7 com.apple.systempreferences 7.0 (7.0) <30C04F1A-7711-1359-8A0E-D707B8BF2EB4> /Applications/System Preferences.app/Contents/MacOS/System Preferences 0x100758000 - 0x10076dfff com.apple.frameworks.opendirectoryconfigui 10.6.4 (10.6.4) <4711F2E8-DFA5-4C81-BB2A-B1E39D5B1B91> /System/Library/PrivateFrameworks/OpenDirectoryConfigUI.framework/Versions/A/OpenDirectoryConfigUI ...

    Read the article

  • Android - creating a custom preferences activity screen

    - by Bill Osuch
    Android applications can maintain their own internal preferences (and allow them to be modified by users) with very little coding. In fact, you don't even need to write an code to explicitly save these preferences, it's all handled automatically! Create a new Android project, with an intial activity title Main. Create two more activities: ShowPrefs, which extends Activity Set Prefs, which extends PreferenceActivity Add these two to your AndroidManifest.xml file: <activity android:name=".SetPrefs"></activity> <activity android:name=".ShowPrefs"></activity> Now we'll work on fleshing out each activity. First, open up the main.xml layout file and add a couple of buttons to it: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"> <Button android:text="Edit Preferences"    android:id="@+id/prefButton"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_gravity="center_horizontal"/> <Button android:text="Show Preferences"    android:id="@+id/showButton"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_gravity="center_horizontal"/> </LinearLayout> Next, create a couple button listeners in Main.java to handle the clicks and start the other activities: Button editPrefs = (Button) findViewById(R.id.prefButton);       editPrefs.setOnClickListener(new View.OnClickListener() {              public void onClick(View view) {                  Intent myIntent = new Intent(view.getContext(), SetPrefs.class);                  startActivityForResult(myIntent, 0);              }      });           Button showPrefs = (Button) findViewById(R.id.showButton);      showPrefs.setOnClickListener(new View.OnClickListener() {              public void onClick(View view) {                  Intent myIntent = new Intent(view.getContext(), ShowPrefs.class);                  startActivityForResult(myIntent, 0);              }      }); Now, we'll create the actual preferences layout. You'll need to create a file called preferences.xml inside res/xml, and you'll likely have to create the xml directory as well. Add the following xml: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> </PreferenceScreen> First we'll add a category, which is just a way to group similar preferences... sort of a horizontal bar. Add this inside the PreferenceScreen tags: <PreferenceCategory android:title="First Category"> </PreferenceCategory> Now add a Checkbox and an Edittext box (inside the PreferenceCategory tags): <CheckBoxPreference    android:key="checkboxPref"    android:title="Checkbox Preference"    android:summary="This preference can be true or false"    android:defaultValue="false"/> <EditTextPreference    android:key="editTextPref"    android:title="EditText Preference"    android:summary="This allows you to enter a string"    android:defaultValue="Nothing"/> The key is how you will refer to the preference in code, the title is the large text that will be displayed, and the summary is the smaller text (this will make sense when you see it). Let's say we've got a second group of preferences that apply to a different part of the app. Add a new category just below the first one: <PreferenceCategory android:title="Second Category"> </PreferenceCategory> In there we'll a list with radio buttons, so add: <ListPreference    android:key="listPref"    android:title="List Preference"    android:summary="This preference lets you select an item in a array"    android:entries="@array/listArray"    android:entryValues="@array/listValues" /> When complete, your full xml file should look like this: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">  <PreferenceCategory android:title="First Category"> <CheckBoxPreference    android:key="checkboxPref"    android:title="Checkbox Preference"    android:summary="This preference can be true or false"    android:defaultValue="false"/> <EditTextPreference    android:key="editTextPref"    android:title="EditText Preference"    android:summary="This allows you to enter a string"    android:defaultValue="Nothing"/>  </PreferenceCategory>  <PreferenceCategory android:title="Second Category">   <ListPreference    android:key="listPref"    android:title="List Preference"    android:summary="This preference lets you select an item in a array"    android:entries="@array/listArray"    android:entryValues="@array/listValues" />  </PreferenceCategory> </PreferenceScreen> However, when you try to save it, you'll get an error because you're missing your array definition. To fix this, add a file called arrays.xml in res/values, and paste in the following: <?xml version="1.0" encoding="utf-8"?> <resources>  <string-array name="listArray">      <item>Value 1</item>      <item>Value 2</item>      <item>Value 3</item>  </string-array>  <string-array name="listValues">      <item>1</item>      <item>2</item>      <item>3</item>  </string-array> </resources> Finally (for the preferences screen at least...) add the code that will display the preferences layout to the SetPrefs.java file:  @Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      addPreferencesFromResource(R.xml.preferences);      } OK, so now we've got an activity that will set preferences, and save them without the need to write custom save code. Let's throw together an activity to work with the saved preferences. Create a new layout called showpreferences.xml and give it three Textviews: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="fill_parent"> <TextView   android:id="@+id/textview1"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="textview1"/> <TextView   android:id="@+id/textview2"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="textview2"/> <TextView   android:id="@+id/textview3"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="textview3"/> </LinearLayout> Open up the ShowPrefs.java file and have it use that layout: setContentView(R.layout.showpreferences); Then add the following code to load the DefaultSharedPreferences and display them: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);    TextView text1 = (TextView)findViewById(R.id.textview1); TextView text2 = (TextView)findViewById(R.id.textview2); TextView text3 = (TextView)findViewById(R.id.textview3);    text1.setText(new Boolean(prefs.getBoolean("checkboxPref", false)).toString()); text2.setText(prefs.getString("editTextPref", "<unset>"));; text3.setText(prefs.getString("listPref", "<unset>")); Fire up the application in the emulator and click the Edit Preferences button. Set various things, click the back button, then the Edit Preferences button again. Notice that your choices have been saved.   Now click the Show Preferences button, and you should see the results of what you set:   There are two more preference types that I did not include here: RingtonePreference - shows a radioGroup that lists your ringtones PreferenceScreen - allows you to embed a second preference screen inside the first - it opens up a new set of preferences when clicked

    Read the article

  • Firefox extension dev: observing preferences, avoid multiple notifications

    - by Michael
    Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function. When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. It's a great redundancy! What I want is observe to be called just once for group of preferences. Say extensions.myextension.interval1 extensions.myextension.site extensions.myextension.retry so if one or all of those preferences are changed, I receive only 1 notification about it. In other words, no matter how many preferences changed in branch, I want the observe callback to called once.

    Read the article

  • Firefox extension dev: observing preferences, avoid multiple notifications

    - by Michael
    Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function. When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. It's a great redundancy! What I want is observe to be called just once for group of preferences. Say extensions.myextension.interval1 extensions.myextension.site extensions.myextension.retry so if one or all of those preferences are changed, I receive only 1 notification about it. In other words, no matter how many preferences changed in branch, I want the observe callback to called once.

    Read the article

  • iphone: accessing the preferences localization file from code

    - by phonecoddy
    I was just facing the following problem and couldn't find a solution for it. Hopefully someone could help. The app I am working on has some preferences, which are using a localization file. Now I want to use labels in my app, which display the exact names, which are used in the localization file for the preferences. But I couldn't find a way to access the information which is stored in Settings.bundle - en.lproj - localizationfile.strings. to make this clear: If you open your preferences for your app, the display shows the localized string of the title and the value of the setting. I need to access the localized string of the title of each preference from my code. Does any know how to do this?

    Read the article

  • Default Eclipse preferences

    - by DanyW
    Hi everyone, I have previously exported the default preferences but accidentally deleted it. Is there anywhere I can download the default set of preferences from? I am running the latest version on Mac OS X. Thanks, Dany.

    Read the article

  • User preferences using SQL and JavaScript

    - by Shyam
    Hi, I am using Server Side JavaScript - yes, I am actually using Server Side JavaScript. To complexify things even more, I use Oracle as a backend database (10g). With some crazy XSLT and mutant-like HTML generation, I can build really fancy web forms - yes, I am aware of Rails and other likewise frameworks and I choose the path of horror instead. I have no JQuery or other fancy framework at my disposal, just plain ol' JavaScript that should be supported by the underlying engine called Mozilla Rhino. Yes, it is insane and I love it. So, I have a bunch of tables at my disposal and some of them are filled with associative keys that link to values. As I am a people pleaser, I want to add some nifty user-preference driven solutions. My users have all an unique user_id and this user_id is available during the entire session. My initial idea is to have a user preference table, where I have "three" columns: user_id, feature and pref_string. Using a delimiter, such as : or - (haven't thought about a suitable one yet), I could like store a bunch of preferences as a list and store its elements inside an array using the .split-method (similar like the PHP-explode function). The feature column could be like the table name or some identifier for the "feature" i want to link preferences too. I hate hardcoding objects, especially as I want to be able to back these up and reuse this functionality application-wide. Of course I would love better ideas, just keep in mind I cannot just add a library that easily. These preferences could be like "joined" to the table, so I can query it and use its values. I hope it doesn't sounds too complex, because well.. its basically something really simple I need. Thanks!

    Read the article

  • Android: preferences not being stored automatically

    - by Vitaly
    I'm trying to use preference screen. I'm following all steps from online tutorial (once I couldn't get it working, I found other tutorials, and steps seem to be fine). I get to preferences screen, edit values, return to calling activity (via hardware return button). In DDMS perspective FileExplorer shows package_name_preferences.xml file with preferences that should be stored. It contains: <?xml version='1.0' encoding='utf-8' standalone='yes' ?> <map> <string name="false">kg</string> </map> while I expect (data line only shown). <string name="weight">kg</string> Also, if I go change only 1 preference, the same value changes, not a new row is created. I'm just tempted to write my own preference classes that would store data in files or DB, but I know that preferences should work, it just doesn't save properly my stuff. Edit Tutorials used: Main Tutorial - Was using this as a base, simplified, as I needed only 3 listPreferences so far. Another One - Used this one back when first installed android, so referred to this one for its section on preferences Code: (Screen loads, so I'm not showing Manifest) public class MyPrefs extends PreferenceActivity { @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); addPreferencesFromResource(R.xml.my_prefs); } } my_prefs.xml <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="Value Settings"> <ListPreference android:title="Distance" android:summary="Metric (Kilometer) vs Imperial (Imperial)" android:defaultValue="km" android:key="@+id/distanceMesurement" android:entries="@array/distance" android:entryValues="@array/distance_values"/> <ListPreference android:title="Weight" android:summary="Metric (Kilogram) vs Imperial (Pound)" android:defaultValue="kg" android:key="@+id/weightMesurement" android:entries="@array/weight" android:entryValues="@array/weight_values"/> </PreferenceCategory> </PreferenceScreen> calling MyPrefs from MainScreen Intent i = new Intent(MainScreen.this, MyPrefs.class); startActivity(i); arrays.xml <resources> <string-array name="weight"> <item name="kg">Kilogram (kg)</item> <item name="lb">Pound (lb)</item> </string-array> <string-array name="weight_values"> <item name="kg">kg</item> <item name="lb">lb</item> </string-array> <string-array name="distance"> <item name="km">Kilometer (km)</item> <item name="mi">Mile (mi)</item> </string-array> <string-array name="distance_values"> <item name="km">km</item> <item name="mi">mi</item> </string-array> </resources>

    Read the article

  • Java preferences API throughput

    - by Domchi
    I'm using Java Preferences API to store window position and size of Swing application. At this moment, I'm listening to window resize/reposition events and storing the position and size every time they change. However, that means that if user slowly resizes window which is 200px wide to 400px wide, I'll probably write new window size about 200 times during pretty short time. Preferences API uses whichever datastore is available on the host system (windows registry for Windows etc.) - but the question is, what are limitations or best practices for properties API? Is it OK, or would it be smart to write only when user has finished resizing? Anyone had experiences with Properties API on different platforms?

    Read the article

  • Where to define a filter function for a form field in my Joomla component's preferences

    - by Herman
    I am creating a component in Joomla 2.5. This component has some options that are defined in its config.xml, so they can be set in the preferences of the component. Now I would like to apply a filter to one of these option fields, using the attribute filter="my_filter". In the source code of JForm I saw the following lines at the very end of the implementation of JForm::filterField(): if (strpos($filter, '::') !== false && is_callable(explode('::', $filter))) { $return = call_user_func(explode('::', $filter), $value); } elseif (function_exists($filter)) { $return = call_user_func($filter, $value); } That's what I needed for using a filter function defined by myself! I managed to do this for form fields used in the views of my component. I defined the filter function as MyComponentHelper::my_filter(), where MyComponentHelper is a helper class which I always load in the very base of my component. And in the form's xml I added filter="MyComponentHelper::my_filter" to the fields that have to be filtered. However... when I am trying to apply the filter function to a form field in my component's preferences, I am not in my own component, but in com_config instead, so my helper class is not available! So, therefore, my question: where to define my own filter function in such a way that it can be found and called by JForm::filterField() in com_config?? Help is very much appreciated.

    Read the article

  • [Android] accessing another Activity's preferences

    - by Raffaele
    I have a Login Activity which stores credentials in its own SharedPreferences; then I added two getters for reading them, something like public String getUsername() { return getPreferences(MODE_PRIVATE).getString("#username", null); } but this throws a NPE when I call it like this String mUser = (new Login()).getUsername(); It seems that the Activity cannot read its preferences after a simple contructor call, as if it were in some uncompleted state. I read lots of related topics, but wasn't able to find a solution. Basically, I need to share these credentials among activities in my application

    Read the article

  • Maintaining a common set of Eclipse preferences

    - by Robert Munteanu
    Whenever I switch workspaces/Eclipse installs I need to copy/redo the preferences: compiler settings; font sizes/families; code formatter; java code templates; editor templates; code clean-ups; I would like to maintain these settings in an unitary way, preferrably under source control. How can I do that? I know about 'copy settings' when creating a new workspace, but it does not keep updated copies.

    Read the article

  • How to display Preferences in a View

    - by Sybiam
    I'm building some sort of wizard to create user accounts in Sync and Manage account. I use a ViewFlipper my activity has to be an AccountAuthenticatorActivity. That said it also means I can't inherit PreferenceActivity. So I looked up in the code of PreferenceActivity and I believe it should be possible to have a PreferenceView that inherit from ListView. The Activity part of PreferenceActivity isn't really needed as far as I know. Though the PreferenceManager is what really blocks me. private PreferenceManager onCreatePreferenceManager() { PreferenceManager preferenceManager = new PreferenceManager(this, FIRST_REQUEST_CODE); preferenceManager.setOnPreferenceTreeClickListener(this); return preferenceManager; } This function imply that we can instatiate PreferenceManager using the operator new. Apparently, the sdk hide the constructor of the PreferenceManager. I'm kind of confused. Is there a way to inflate my preferences and display them without PreferenceActivity?

    Read the article

  • FF extension: saving a value in preferences and retrieving in the js file

    - by encryptor
    I am making an extension which should take a link as the user input only once. Then the entire extension keeps using that link on various functions in the JS file. When the user changes it, the value accessed by the js file also changes accordingly. I am using the following but it does not work for me var pref_manager = Components.classes["@mozilla.org/preferencesservice;1"].getService(Components.interfaces.nsIPrefService) function setInstance(){ if (pref_manager.prefHasUserValue("myvar")) { instance = pref_manager.getString("myvar"); alert(instance); } if(instance == null){ instance = prompt("Please enter webcenter host and port"); // Setting the value pref_manager.setString("myvar", instance); } } instance is the global variable in which i take the user input. The alert (instance) does not show up, which means there is some problem by the way i am saving the pref or extracting it. Can someone please help me with this. I have never worked with preferences before. so even if there are minor problems i might not be able to figure out.

    Read the article

  • Xcode - "Preference Pane" project - how to access bundle?

    - by Nippysaurus
    I have created a "Preference Pane" project. In this project I would like to load an image from my bundles resources folder. This seems difficult because "[NSBundle mainBundle]" seems to return the following: 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </Applications/System Preferences.app> (loaded) Iterating through "[NSBundle allBundles]" reveals that my projects bundle appears, but does not appear to be loaded: 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Mouse.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Sound.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Spotlight.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/TimeMachine.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </Library/PreferencePanes/DivX.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Trackpad.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/UniversalAccessPref.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Dock.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/DateAndTime.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Keyboard.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/MobileMe.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/FibreChannel.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Appearance.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/DigiHubDiscs.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Ink.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Security.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/EnergySaver.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Speech.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </Users/michael/Library/PreferencePanes/MyPrefPane.prefPane> (loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </Users/michael/Code/MyPrefPane/build/Debug/MyPrefPane.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/SharingPref.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Expose.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/SoftwareUpdate.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/ParentalControls.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/PrintAndFax.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Accounts.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Bluetooth.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Localization.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/StartupDisk.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Network.prefPane> (not yet loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </Applications/System Preferences.app> (loaded) 27/12/10 9:24:18 PM System Preferences[5076] NSBundle </System/Library/PreferencePanes/Displays.prefPane> (not yet loaded) I'm not sure whats going on here. How can I access my prefpane bundle?

    Read the article

  • Dismiss android preferences dialog on Keyboard ACTION_DONE press

    - by Damian
    I would like to be able to close the editpreference dialog (as shown here http://twitpic.com/18ttdp) by pressing the 'Done' button on the keyboard. Currently, pressing 'Done' just dismisses the keyboard but leaves the dialog. In other parts of my application I use code similar to the following to intercept the 'Done' key press and execute actions in my activity: text.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { //do stuff here return true; } return false; } }); However, I am unsure of how to do achieve this same effect in my preference activity or layout xml.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >