I know this is an old post, but recently I had this problem on my tablet that does not have a physical scroll button (like my phone) to scroll through the list items (without actually selecting the item by clicking on It). On my phone, when I look at the list items, the βbrandβ has always worked from day one. So I played a little onListItemClick ...
This is the result:
@Override protected void onListItemClick(ListView list, View v, int position, long id) { final View t = v.findViewById(R.id.YOURTEXTVIEW_ID_HERE); t.requestFocusFromTouch(); list.setSelectionFromTop(position, v.getTop()); super.onListItemClick(list, v, position, id); }
I tried all kinds of combinations of requestFocus, requestFocusFromTouch and list.setSelectionFromTop, but the above combination is the minimum of methods necessary for its operation, and so that the list remains in the position in which it is located. works with list.setSelection (position), but then the selected item will be deleted as far as possible at the top of the list, since this method is designed for this.
In xml, I got:
android:ellipsize="marquee" android:singleLine="true"
source share