Java tutorial
//package com.java2s; import android.content.Context; import android.text.Selection; import android.text.Spannable; import android.widget.EditText; public class Main { public static void setCursorLocation(Context context, EditText editText) { CharSequence text = editText.getText(); if (text instanceof Spannable) { Spannable spanText = (Spannable) text; Selection.setSelection(spanText, text.length()); } } }