I have an app that needs to be able to pass a set of settings to my Live
Wallpaper.
The Live Wallpaper already saves these in a Shared Preferences file.
I did a bunch of searches, and found a possible way for the app to access
the wallpapers Shared prefs was:
(I've also set both apps to have the same uid in their manifest files.)

                    Context context =
this.createPackageContext("com.casadelgato.lifewallpaper", 0);
                    SharedPreferences wPrefs =
context.getSharedPreferences(Constants.LW_SHARED_PREFS, 0);
                    Editor editor = wPrefs.edit();
                    editor.putBoolean(Constants.PREF_RANDCOLORS,
engine.isRandColors());
etc...

When I try, I get:

01-12 10:37:20.728: WARN/ApplicationContext(293): Attempt to read
preferences file
/data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
without permission
01-12 10:37:20.757: ERROR/ApplicationContext(293): Couldn't rename file
/data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
to backup file
/data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml.bak

Am I missing something?  Or is this just the wrong way to do it.

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

Reply via email to