Astonex/Antox — pull request #187 by Corly (2014-03-16 17:30:27+00:00)
Title: Fixed app crashing posibilities.

Firstly, I tried to fix Issue #173 by adding "configChanges" into the Manifest file. It now depends on orientation and screenSize. This will make the activity not to reload when the orientation is changed.

I don't know if it is wanted for the app to save the current state programmatically and then restored it in the same away. But for now, I think this is a fine solution.

Secondly, I fixed Issue #186 . In some cases, when a contact is clicked the app crashes.
I tracked this bug down to this line in the ChatFragment.java file:
main_act.activeTitle = toxSingleton.friendsList.getById(toxSingleton.activeFriendKey).getName();

The reason why it crashed is because the method "getById" returns null. And the reason for it is that the Service "ToxDoService" takes some time to load data from Tox Database and the "friendsList" is empty at that moment.

So what I've done was to add a progress dialog which let the user know that we are still loading the data and after all is ready the messages from the "clicked" contact are shown.