Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SharedPreferences problem

 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have this code:



But I get this error:

Couldn't create directory for SharedPreferences file /data/data/org.quens.xno/shared_prefs/org.quens.xno.xml

I don't knwo what's the problem. I tried to look up on the net, but no results.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is org.quens.xno the application you are writing? Because it looks like you don't have permissions to write in that context.
 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No it is the package. This code is from the class org.quens.xno.MainActivity.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hrm... are you testing in the emulator or on your real phone? What version of Android? There seemed to be a problem with Samsung in version 2.x that had this problem. Another thing to try would be to use the android adb tools to connect to the device and see if the file already exists - perhaps another app had created one with the same name?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic