I have a populated database that should be copied if database not exist(Often occurred when application is installed). I have problem in checking database existence.
if (!new File(context.getDatabasePath(DATABASE_NAME), DATABASE_NAME).isFile()) {
// database not exist
}
or
if (!new File(context.getDatabasePath(DATABASE_NAME), DATABASE_NAME).exists()) {
// database not exist
}
In the both of upper cases, result is true while database does not exist!