I am running the below code inside a new thread that I create by doing:
new Thread(new Runnable() {
    public void run() {
        // CODE BELOW
    }
}).start();
So my runonUI code is never being executed. I am under the impression that I need to run it on the UI thread in order to update the adapter. Also am I updating the adapter correctly?
Log.d(App.app.chats.toString(),"THIS IS THE TEXTS WE SHOULD DISPLAY");
((ArrayAdapter)App.app.chatDisplay.getAdapter()).clear();
for (int i = 0; i < App.app.chats.size(); i++) {
    ((ArrayAdapter)App.app.chatDisplay.getAdapter()).add(App.app.chats.get(i));
}
activity.runOnUiThread(new Runnable() {
    @Override
    public void run() {
        Log.d("THIS IS ACTUALLY RUNNING","TEST");
        ((BaseAdapter)App.app.chatDisplay.getAdapter()).notifyDataSetChanged();
    }
});
				
                        
If I understand your question correctly, You can not modify an
ArrayAdapterfrom a background thread. Both theclearandaddmethod calls internally invokenotifyDataSetChanged. Which means yournotifyDataSetChangedinvocation is sorta redundant and that thread is crashing before you even get to yourrunOnUiThreadline.A quick workaround for you would be to add the following before you mutate the adapter.
That will disable the internal
notifyDataSetChangedinvocation. The flag will reset once you manually invoke it yourself. Also note, theArrayAdapterwas never intended to be mutated from a background thread like that. While the above solution should get it working for you, I highly recommended moving those mutate method calls to the UI thread.