为什么我一运行蹦掉呢?我就是按老师一样的代码啊
package com.sorgs.administrator.sqlitedatabasedemo1;
import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//每个程序都有自己的数据库 默认情况下是各自互相不干扰
//创建一个数据库 并且打开
SQLiteDatabase db = openOrCreateDatabase("user.db", MODE_PRIVATE, null);
db.execSQL("create table if not exists usertb (_id integer primary key autoincrement, name text not null , age integer not null , sex text not null )");
db.execSQL("insert into usertb(name,sex,age) values('张三','女',18)");
}
}