realm / realm-tasks

To Do app built with Realm, inspired by Clear for iOS
Other
369 stars 71 forks source link

[Android] Create initial data not only when app registers an account but also logs in #329

Closed zaki50 closed 8 years ago

zaki50 commented 8 years ago

There is a case that the database is empty when the app logged into the server.

@realm/java

zaki50 commented 8 years ago

I've checked the app again and it worked as expected.

jpsim commented 8 years ago

FWIW, the iOS and macOS versions always create the initial list if the Realm is empty: https://github.com/realm/RealmTasks/blob/v0.2.2/RealmTasks%20Apple/RealmTasks%20Shared/SharedFunctionality.swift#L34-L43

zaki50 commented 8 years ago

@jpsim thank you for your comment.

I think the logic is almost the same. createInitialDataIfNeeded() which is add in this PR is executed in the following cases.