Update MainActivity.java

Internet connection check added