Wednesday, March 14, 2012

Re: [android-developers] Can I have a preference with no UI?

Of course you can, this is how shared preferences are most widely used.

kris

On Wed, Mar 14, 2012 at 5:35 PM, RedBullet <scottedchapman@gmail.com> wrote:
> Thanks, I'll try that.
>
> I am using a PreferencesActivity to manage the display and updating of the
> values, and I created a preferences.xml that details it.
>
> So, I assume that I can programatically add/modify additional ones as you
> describe?
>
>
> On Wednesday, March 14, 2012 4:45:56 PM UTC-4, MagouyaWare wrote:
>>
>> String prefKey = "my_pref_key";
>> String prefVal = "my_pref_value;
>>
>> SharedPreferences prefMgr =
>> PreferenceManager.getDefaultSharedPreferences(context);
>> Editor prefEdit = prefMgr.edit();
>>
>> prefEdit.putString(prefKey, prefValue);
>>
>>
>> prefEdit.commit();
>>
>>
>> Thanks,
>> Justin Anderson
>> MagouyaWare Developer
>> http://sites.google.com/site/magouyaware
>>
>>
>> On Wed, Mar 14, 2012 at 2:34 PM, RedBullet <> wrote:
>>>
>>> I have a bunch of preferences that I want the user to be able to set, but
>>> I also want to be able to store some values to keep between executions of my
>>> program. I didn't see a way to do this with shared preferences...
>>>
>>> Do I need to use something different??
>>>
>>> --
>>>
>>
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate