logcat的
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.greynium.bhaktiapp/com.greynium.bhaktiapp.BhagavdGeeta}: android.database.sqlite.SQLiteException: no such table: bg_eng_chapters (code 1): , while compiling: SELECT upper(chapter_name),id FROM bg_eng_chapters
代码
private void dataFromDB(){
geetaSql=SplashActivity.csSql;
String strOrderby="select upper(chapter_name),id from bg_eng_chapters";
geetaSql=openOrCreateDatabase(SplashActivity.DB_NAME,SQLiteDatabase.CREATE_IF_NECESSARY,null);
Cursor csCursor = geetaSql.rawQuery(strOrderby, null);
if( csCursor.getCount() > 0)
{
if(csCursor.moveToFirst())
{
do {
String csChapter = csCursor.getString(0);
String csId = csCursor.getString(1);
try {
byte[] bb = csChapter.getBytes("ISO-8859-1");
byte[] bb1 = csId.getBytes("ISO-8859-1");
String ss = new String(bb, "UTF-8");
String ss1 = new String(bb1, "UTF-8");
geeta_catg.add(ss);
geetaid.add(ss1);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} while (csCursor.moveToNext());
}
}
csCursor.close();
geetaSql.close();
}