TextView に autolink = "web" を定義しようとしています。驚いたことに、これを宣言すると、TextView のテキストが非表示になり、最初のクリックでのみ表示されます。これは非常に驚くべきことであり、アプリケーションの多くの部分で同じ機能が正常に動作します。これは、問題が何であるかを見つけることができなかった唯一の場所です。
解決策を教えてください:
ここに私の TextView XML コードがあります:
<TextView
android:id="@+id/details_webAddress_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/details_location_textView"
android:drawableLeft="@drawable/icon_website_earth"
android:drawablePadding="5dp"
android:gravity="center"
android:padding="5dp"
android:singleLine="true"
android:autoLink="web"
android:text="www.google.com"
android:visibility="visible" />
以下は、自動リンクがうまく機能する TextView です。
<TextView
android:id="@+id/websiteAddress_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:padding="5dp"
android:singleLine="true"
android:text="www.stackoverflow.com" />