android使用litepal出现的两个错误
问题描述:
org.litepal.exceptions.DataSupportException: unable to open database file (code 14)
org.litepal.exceptions.DataSupportException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
向高手求教
答
第一个问题, 暂时这样处理
/* 初始化litepal, 执行sql是创建临时文件, 解决此问题:SQLiteCantOpenDatabaseException: unable to open database file (code 14) */
Connector.getDatabase().execSQL("PRAGMA temp_store_directory = '/data/data/com.tianyuan.inspectionsystem/databases'");
答
row 0, col 0 读取到0行0列,可能是你访问数据库的地方出错啦