Question

I have some problems with an app of mine and a Galaxy Nexus 10 with multi user support. My app has to copy a database, this works fine when I am logged in as the first user of the tablet, but it fails with

java.io.FileNotFoundException: /data/data/packagename/dbname.db: open failed: EACCES (Permission denied)

when I am logged in with the second account. The second account seems to have no rights to write to /data/data...

So, what can be done about it? I already read some of the topics concerning this problem, still no answer which satisfies me. Is there a folder which can be used to share data between users?!

Était-ce utile?

La solution

The second account seems to have no rights to write to /data/data...

Correct.

So, what can be done about it?

I am guessing that you hard-coded a path. If so, do not do this. Use getDatabasePath() to find the proper path to the database for the current user.

Is there a folder which can be used to share data between users?!

Not that I am aware of. Even external storage is separate between users. In effect, separate user accounts on a device are as if those users are on completely separate devices.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top