Shuffled some methods around in MainActivity.java for improved readability.