网络请求长按点击数据库4MyApp

2017-12-13  本文已影响0人  百读者

public class MyApp extends Application {

private static MyApp myApp;

private DaoSession mDaoSession;

public static MyApp getMyApp() {

return myApp;

}

@Override

public void onCreate() {

super.onCreate();

myApp = this;

createDB();

}

private void createDB() {

DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(myApp, "test");

DaoMaster daoMaster = new DaoMaster(devOpenHelper.getWritableDatabase());

mDaoSession = daoMaster.newSession();

}

public DaoSession getmDaoSession() {

return mDaoSession;

}

上一篇 下一篇

猜你喜欢

热点阅读