Skip to content

Commit

Permalink
update README with FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianTerhorst committed Feb 2, 2016
1 parent 63c2fb3 commit 4a54d2d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,19 @@ TwitterApi twitter = Twitter.getInstance();
twitter.getTweets().subscribe(tweets-> System.out.println(tweets));
```

###FAQ

RealmList doesn´t support null objects. How can i ignore null object inside the response json?

You can override the gson builder inside your api class and add custom deserializer adapters to avoid adding null objects.

```
@Override
public GsonBuilder getGsonBuilder(GsonBuilder gsonBuilder) {
registerRemoveNullListSerializer(gsonBuilder, new TypeToken<RealmList<MyFirstObject>>() {}, MyFirstObject.class)
.registerRemoveNullListSerializer(gsonBuilder, new TypeToken<RealmList<MySecondObject>>() {}, MySecondObject.class)
.registerRemoveNullListSerializer(gsonBuilder, new TypeToken<RealmList<MyThirdObject>>() {}, MyThirdObject.class);
return gsonBuilder;
}
```

0 comments on commit 4a54d2d

Please sign in to comment.