سؤال

i have a class that needs to save persistent data and i don't want to need to worry about other classes accessing my database by accident using the same name. so my question is, if i create my own subclass of SQLiteOpenHelper is the database created by this subclass only accessible to that class?

هل كانت مفيدة؟

المحلول

Databases are bound to your app, by the package name specified in the manifest. Android framework guarantees that there can be only one app with a particular package name installed at any one time.

Inside your app you will have to coordinate yourself that there are no name clashes in database file names.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top