0

EditText + beforeTextChanged + getSelectionStart

view story
linux-howto

http://stackoverflow.com – I'm trying to get selectionStart and selectionEnd before the text in EditText was changed. public void beforeTextChanged(CharSequence s, int start, int count, int after) { TextView textView = (TextView)findViewById( R.id.text_view ); EditText textEdit = (EditText)findViewById( R.id.text_edit ); textView.setText( Integer.toString( textEdit.getSelectionStart() ) ); textView.append( " " + Integer.toString( textEdit.getSelectionEnd() ) ); } But getSelectionStart and getSelectionEnd returns the same value that equals SelectionEnd. Ca (HowTos)