Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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