Update Activity2.java

Formatted and Updated code to prevent app crash from rotation.