I have a ListView with an EditText on each row working.
I need to select this text on click the edittext to write numbers without erasing or moving the cursor.
Not sure if you are still looking for a solution, but I found a way to do it. Add a focus change listener to the edittext in the getView method of your adapter and select all text when focus is received.
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
// blah blah blah
EditText edit = (EditText) view.findViewById(R.id.editTextId);
edit.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (hasFocus)
((EditText) view).selectAll();
}
});
return view;
}
I had set windowSoftInputMode to adjustPan for the activity, although I don't think it has any bearing on this matter.
I have tested this on Android 2.3 and 4 and it works.