TextView's ellipsize not working on maxLines = 1

There are two ways to fix it:

  1. Try to change android:ellipsize="end" attribute to android:ellipsize="marquee".
  2. Try to remove android:maxLines="1" android:ellipsize="end" attributes and add android:singleLine="true" attribute.

This code works for me:

In the xml add:

  • Attribute ellipsize: marquee
  • Attribute lines: 1

In java:

<yourTextView>.setHorizontallyScrolling(true);
<yourTextView>.setSelected(true);

If there is another item that request the "focus" you lose the marquee effect. The textView need the state selected to prevent this.