EDIT: Removed Previous Code For Clarity
On suggestion, I added log messages to see where I am getting stopped up.
It appears that it is properly throwing the call to checkDatabase()
, but not going back to copy the database. This is my checkDatabase()
method:
File dbFile = new File(DB_PATH + DB_NAME);
if(dbFile.exists()){
Log.d("True","Returned true");
return true;
}else{
dbFile.getParentFile().mkdirs();
Log.d("CreatedPath","Made the right directory");
return false;
}
In the debug logs I can see my 'Created Path' message. So it's getting that far.
It then returns false, which should start this:
public void createDataBase() throws IOException{
boolean dbExist = checkDatabase();
if (!dbExist){
this.getReadableDatabase();
// Calling this method an empty database will be
// created into the default system path of
// the app so we can overwrite with FirstDB.
try{
copyDatabase();
}catch (IOException e) {
throw new Error("Error copying database");
}
}
}
However, I am not seeing those log messages at all. It's like it returns false and just keeps on moving.
Do I need to call createDataBase()
again?