Based on the error message, the problem is likely that you are modifying the contents of your adapter within the callback "onConversationMessage." This is not likely running on the main thread and so cannot be used to update your adapter. What you could do to fix this is move your methods that deal with the adapter into a Runnable
and then get the Activity
context from within onConversationMessage and run on UI thread from there.
Runnable updateAdapter = new Runnable(){
@Override
public void run(){
//Move all your actions updating adapter here
}
}
Then within your onConversationMessage if you're within a fragment
getActivity().runOnUiThread(updateAdapter);
If you're in an activity you can use that as your context
ActivityName.this.runOnUiThread(updateAdapter);
You will have to change your structure slightly to make this work. For example, you're adapter will likely need to be an instance variable so that you end up updating the same adapter you're applying to the list.