Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一下,无法打开china_cities.db #7

Closed
syBlack opened this issue Jan 10, 2017 · 2 comments
Closed

请教一下,无法打开china_cities.db #7

syBlack opened this issue Jan 10, 2017 · 2 comments

Comments

@syBlack
Copy link

syBlack commented Jan 10, 2017

您好,请问下我按照这个代码在eclipse上写了一遍之后无法打开china_cities.db,我看了下目录里面没有database这个目录,但是mkdirs这个方法执行了。Log:Failed to open database '/data/data/database/china_cities.db';android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database。

@zaaach
Copy link
Owner

zaaach commented Jan 10, 2017

DB_PATH = File.separator + "data"
+ Environment.getDataDirectory().getAbsolutePath() + File.separator
+ context.getPackageName() + File.separator + "databases" + File.separator;
你看下DBManager.java这个文件里上面这个是不是少写了包名

@syBlack
Copy link
Author

syBlack commented Jan 12, 2017

是少了 context.getPackageName(),已经弄出来了,谢谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants