Update MainActivity.java

Greater flexibility in generating the poly line