Search Results

Search found 2 results on 1 pages for 'budius'.

Page 1/1 | 1 

  • Android XML Preference issue. Can't make it persistent

    - by Budius
    I have a very simple activity just to show the preference fragment: public class PreferencesActivity extends Activity { Fragment frag = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentTransaction ft = getFragmentManager().beginTransaction(); if (frag == null) { // If not, instantiate and add it to the activity frag = new PrefsFragment(); ft.add(android.R.id.content, frag, frag.getClass().getName()); } else { // If it exists, simply attach it in order to show it ft.attach(frag); } ft.commit(); } private static class PrefsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } } } and preferences.xml with persistent to true: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:enabled="true" android:persistent="true" android:title="@string/settings" > <EditTextPreference android:dialogTitle="@string/dialog_ip" android:negativeButtonText="@android:string/cancel" android:persistent="true" android:positiveButtonText="@android:string/ok" android:title="@string/ip" /> </PreferenceScreen> if I open the EditTextPreference, write something, close the dialog and open it again. The value is still there. But that's it... if I click the Back button, and enter the again on the preferences screen, I already lost what was written. If you exit the application also doesn't save. Am I missing something here? Running on: Android 4.0.3 Asus TF300

    Read the article

  • VB.net SyncLock Object

    - by Budius
    I always seen on SyncLock examples people using Private Lock1 As New Object ' declaration SyncLock Lock1 ' usage but why? In my specific case I'm locking a Queue to avoid problems on mult-threading Enqueueing and Dequeueing my data. Can I lock the Queue object itself, like this? Private cmdQueue As New Queue(Of QueueItem) ' declaration SyncLock cmdQueue ' usage Any help appreciated. Thanks.

    Read the article

1