Update MainActivity.java

try/catch add