CharSequence charSequence = login_password.getText();
if (charSequence instanceof Spannable) {
Spannable spanText = (Spannable) charSequence;
Selection.setSelection(spanText,
charSequence.length());
}