Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save janishar/679d4ce6d53358eb169b35c4acf55c3d to your computer and use it in GitHub Desktop.
Save janishar/679d4ce6d53358eb169b35c4acf55c3d to your computer and use it in GitHub Desktop.
@Override
public void onCreate() {
super.onCreate();
mDaoSession =
new DaoMaster(new DbOpenHelper(this, "greendao_demo.db").getWritableDb()).newSession();
// USER CREATION FOR DEMO PURPOSE
if(mDaoSession.getUserDao().loadAll().size() == 0){
mDaoSession.getUserDao().insert(new User(1L, "Janishar Ali","", ""));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment