Skip to content

Commit cec1686

Browse files
authored
Fix enableLocalDataStore usage (#807)
1 parent a1c91f3 commit cec1686

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

_includes/android/local-datastore.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ public class App extends Application {
1717
}
1818
```
1919

20+
If you use a `Parse.Configuration.Builder`, enable it there instead:
21+
22+
```java
23+
Parse.initialize(new Parse.Configuration.Builder(context)
24+
.server(...)
25+
.applicationId(...)
26+
.enableLocalDataStore()
27+
.build());
28+
```
29+
2030
There are a couple of side effects of enabling the local datastore that you should be aware of. When enabled, there will only be one instance of any given `ParseObject`. For example, imagine you have an instance of the `"GameScore"` class with an `objectId` of `"xWMyZ4YEGZ"`, and then you issue a `ParseQuery` for all instances of `"GameScore"` with that `objectId`. The result will be the same instance of the object you already have in memory.
2131

2232
Another side effect is that the current user and current installation will be stored in the local datastore, so you can persist unsaved changes to these objects between runs of your app using the methods below.

0 commit comments

Comments
 (0)