Android- URI of a Created SQLite Database
I created a database in Android using below line of code-
SQLiteDatabase sampleDB = this.openOrCreateDatabase("SAMPLE_DB_NAME", MODE_PRIVATE, null);
Now, i want to know what would be the Uri for this database or how to find the Uri of the created database.Please hel开发者_C百科p me out.
Thanks in Advance Manoj
content://com.package_name.dbprovider_name/table_name
you have implement following code
File dbFile = this.getDatabasePath(DB_NAME);
for (File f:files)
{
if (f.isDirector)
searchFile(f);
else if (f.getName().equals("accounts.db"))
{
// delete db here...
// and exit the search here...
}
}
if it contains the accounds.db. If you reach another subdirectory, call your own function recursively with the subfolder as the starting point,
精彩评论