Update MainActivity.java

Using the cursor