我正在玩一些 SQLLite 基础知识,我尝试从我的 Activity 类中创建一个非常简单的数据库。应用程序运行正常,但是当我进入模拟器的文件资源管理器时,没有创建数据库,这里有什么问题?
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
class sql1 extends SQLiteOpenHelper {
public static final String DBNAME="coordinates";
public static final String TBNAME="show";
private static final int Version=1;
public sql1(Context context, String name, CursorFactory factory, int version){
super(context, DBNAME, factory, Version);
}
@Override
public void onCreate(SQLiteDatabase arg0) {
String CREATE_TABLE ="CREATE TABLE IF NOT EXISTS Names (Time VARCHAR,Long VARCHAR, Lang VARCHAR);";
arg0.execSQL(CREATE_TABLE);
Log.d("TAG","Created Database");
}
@Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
// TODO Auto-generated method stub
}
}
}