private SQLiteDatabase db = null;
private final String DB_NAME = "myDB";
I just created a DB and tables. I need to check whether there is a db is present from another button clicking.
db = this.openOrCreateDatabase("myDB", MODE_PRIVATE, null);
You can check if the database file exist; you can get the database File object using getDataBasePath():
File dbFile = getDatabasePath(DATABASE_NAME); // add the database file name like "myDatabase.db"
if (dbFile.exists())
Log.d("LOG_TAG", "Database exists");
else
Log.d("LOG_TAG", "Database doesn't exists");