Update MainActivity.java

Moved all variables out of the onCreate and added comments.