bump... On Nov 17, 4:48 pm, cvance383 <[email protected]> wrote: > Trying to create shared preferences for my class representing my api > and one for my main class. I create a shared preference file by making > this call in my api & main classes > > String PREF_NAME = "API"; > > this.pref = context.getSharedPreferences( PREF_NAME, > Context.MODE_PRIVATE ); > > the log gives me this > > 11-17 16:18:19.786: ERROR/ApplicationContext(13584): Couldn't create > directory for SharedPreferences file /data/data/com.*.android/ > shared_prefs/API.xml > > which I believe is because of the call I make above. I do not get this > error however when I run the app on my 1.5 phone, only when i run it > on my 2.0 droid. > > I believe this is leading to the major problem I am having, I get a > null pointer on the 2.0 phone when it makes this call of my code... > > OutputStream out = this.context.openFileOutput( fileName, > Context.MODE_PRIVATE ); > > with this in the log > > 11-17 16:47:25.350: ERROR/AndroidRuntime(13584): > java.lang.NullPointerException > 11-17 16:47:25.350: ERROR/AndroidRuntime(13584): at > android.app.ApplicationContext.openFileOutput(ApplicationContext.java: > 395) > 11-17 16:47:25.350: ERROR/AndroidRuntime(13584): at > android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158) > > I'm pretty sure these are related because I get them both on the 2.0 > phone, and neither when I run on 1.5 . Any help will be awesome and > greatly appreciated.
-- 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

