When is onCreate called ?
See original GitHub issueHello !
I cloned my android project sources to a new machine and tried Android Studio 2.0 (possibly unrelated to my issue), and now my app complains that the tables I’m using do not exist.
I do the calls to init
and terminate
in the onCreate
and onTerminate
in my application (by extending SugarApp
), but the database schema is never created on a fresh install on a new emulator.
Can this possibly be due to the new Android SDK ?
I don’t understand when or where and by whom the onCreate
of SugarDb
is called. I’m new to Android, I know the OS itself handles the calls to the onCreate
of my app and activities, but how are the calls to the SugarDb
event listeners handled ? If the OS calls them, where do SugarDb
registers itself to the OS ? I can’t find it in the source for the life of me and I’m pretty sure that should be done when the app installs itself on the phone.
I have the same “error” (no schema in the database when I first try to access it) on both versions 1.3
and 1.5
of sugardb. It’s probably stupid, but I’ve slept on it twice now and I’m still confused.
It worked fine on my other machine (which now is dead beyond repair after a decade of faithful services).
The whole sources of my learner’s app are available here : https://github.com/Give2Peer/g2p-client-android
(disclaimer : the code WILL hurt your eyes, sorry about that ; I’m learning)
Has anyone managed to run sugardb on the new (2.0) Android Studio ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top GitHub Comments
And if anyone else reads this and needs to switch to master too, I did it with https://jitpack.io but I had to upgrade Gradle to
2.12
too.Sugar’s giving the sweetness, now. 🍬
Thanks for the tip and the pull request ! Will try the master branch.