小编Sla*_*nie的帖子

在android上的sqlite数据库中创建表

@Override
        public void onCreate(SQLiteDatabase db)
        {
            try{
                db.execSQL("create table " +          NotificationManager.getUserStatic(context) + "log ("+
                KEY_TIME +" INTEGER primary key, "+ KEY_TEXT +" TEXT not null);");

            }
            catch (SQLException e) {
                e.printStackTrace();
            }
        }

        /**
         * onOpen method called when app is opening.
         */

        @Override
        public void onOpen(SQLiteDatabase db)
        {
            try{
                System.out.println("tophere");
                db.execSQL("create table if not exists "+DATABASE_NAME+"." + NotificationManager.getUserStatic(context) + "log ("+
                KEY_TIME +" INTEGER primary key, "+ KEY_TEXT +" TEXT not null);");
                System.out.println("downhere");
            }
            catch (SQLException e){
                e.printStackTrace(); …

sqlite android android-logcat

6
推荐指数
1
解决办法
7万
查看次数

标签 统计

android ×1

android-logcat ×1

sqlite ×1