Skip to content Skip to sidebar Skip to footer

Arraylist Add To New Recyclerview

Hi I am trying to add a new item to my chat, I use RXJava2, to make call to my REST API to get the chat data, with this nested json response. But I get an NullPointer when I try to

Solution 1:

I think you need to initialized private ArrayList messageArrayList; you need to create new ArrayList before adding contain on this list

Solution 2:

When you instantiate ChatMessages object the user field in that object is null. you must call setUser(ChatMessageUser user) method and pass an existing user object to it before calling add.getUser().setUserId(userid).

Post a Comment for "Arraylist Add To New Recyclerview"