概要
TextViewのEllipsizeを設定して「...」を表示させる設定をした場合、GALAXY J(Android4.3.0)でArrayIndexOutOfBoundsExceptionで落ちる現象が発生した。
詳細
以下のようなXML定義したところ問題が発生した。
<TextView
android:id="xxx"
android:ellipsize="end"
android:scrollHorizontally="true"
android:singleLine="true"/>
文字列は動的に設定して、「...」が発生する文字列の場合に発生しました。
GALAXY S2(Android4.0.4)では発生しないため、特定のバージョンでのバグの可能性があります。
解決法
<TextView
android:id="xxx"
android:scrollHorizontally="true"
android:lines="1"
android:singleLine="true"/>
android:singleLineをandroid:lines="1"とandroid:singleLine="true"で回避出来る模様。
では、2行以上で「...」を実現したい場合はどうすればいいか?は今のところわかってません。
Google先生が早くバグフィックスしてくれることを祈りましょう。
ちなみに私は仕様を変更して逃げました。