Creating tables in sqlite database on android

前端 未结 5 1022
误落风尘
误落风尘 2020-12-17 02:28
@Override
        public void onCreate(SQLiteDatabase db)
        {
            try{
                db.execSQL(\"create table \" +          NotificationManager.getUserSt         


        
5条回答
  •  萌比男神i
    2020-12-17 02:42

    First of all I would recommend using android.util.Log for logging exceptions in Android.

    Second - I suspect you have tables with wrong names created. Your error says query can't find "log", but I see you make some concatenation in "CREATE" statement. That may be the reason.

    You can check what is actually created for you. By viewing the sqlite base created.

    You can try:

    1. adb shell
    2. cd /data/data//databases
    3. sqlite3
    4. .tables

提交回复
热议问题