我需要从文件(例如sdcard的示例)打开Sqlite数据库。 我得到了Uri:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
接下来我尝试:
sqLiteDatabase = SQLiteDatabase.openDatabase(uri.getPath(), null,
SQLiteDatabase.OPEN_READONLY);
并得到错误:
E/SQLiteLog: (14) cannot open file at line 35803 of [605907e73a]
(14) os_unix.c:35803: (2)
open(/document/raw:/storage/emulated/0/Download/jym.db) -
E/SQLiteDatabase: Failed to open database
'/document/raw:/storage/emulated/0/Download/jym.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown
error (code 14): Could not open database