Re: [android-developers] Is it possible to have dynamicly generated keys in a preferance screen?

2011-02-06 Thread TreKing
On Sat, Feb 5, 2011 at 8:58 PM, ThomasWrobel  wrote:

> Do I have to manualy commit?
>

Possibly. Try it, see what happens.


> or set the persistance to true? (isn't that default).
>

The preferences will save their values automatically when the user makes a
selection. If you manually setting the values, you normally do an
Editor().commit() call once you're done making changes.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Is it possible to have dynamicly generated keys in a preferance screen?

2011-02-05 Thread ThomasWrobel
On my PreferenceActivity onCreate I tried adding a ;

this.findPreference("WaveID_BillBoard_Scaleing").setKey(value
+"_BillBoard_Scaleing");
...
... (other similiar lines)
...

Where "value" was a string passed to the intent.

My intention was to be able to create an arbitary number of different
preferance "sets" each with a different prefix.

However, none of this information seems to be saving.
I'm testing it both with;

Log.i("wavepref", "BillboardScaleing set to
"+this.getPreferences(MODE_WORLD_READABLE).getString(value
+"_BillBoard_Scaleing", "no value set"));

It always says "no value set" however, and no changes are remembered
in the interface.

Do I have to manualy commit? or set the persistance to true? (isn't
that default).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en