Os pongo los dos archivos el que me funciona con una sola base de datos:
Código:
public static void initialize(SQLiteDatabase db, Context ctx) {
// Initialize DB
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
ctx.getAssets().open("InitializeDB.txt"), "UTF-8"));
// do reading, usually loop until end of file reading
String mLine = reader.readLine();
while (mLine != null) {
// process line
db.execSQL(mLine);
mLine = reader.readLine();
}
reader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Y el modificado que no funciona con las modificiaciones que me habéis indicado.
Código:
public static void initialize(SQLiteDatabase db, Context ctx) {
// Initialize DB
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
ctx.getAssets().open(getString("R.string.InitializeDB")), "UTF-8"));
// do reading, usually loop until end of file reading
String mLine = reader.readLine();
while (mLine != null) {
// process line
db.execSQL(mLine);
mLine = reader.readLine();
}
reader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static String getString(String string) {
// TODO Auto-generated method stub
return null;
}
y este el string por ejemplo el español
Código:
<string name="InitializeDB">InitializeDB-es.txt</string>
¿Donde veis el fallo? Muchas gracias por vuestra ayuda.