Open naveenvenkannagari opened 7 years ago
As we can
@naveenvenkannagari The links are clickable.. To create an expendableTextView, we have to make a TextView inside it with id of "expandable_text". Just declare the "expandable_text" in your java class
TextView expandable_text = (TextView) findViewById(R.id.expandable_text);
then set the LinkMovementMethod to it
expandable_text.setMovementMethod(LinkMovementMethod.getInstance());
Make sure theres NO android:autoLink="web"
on your layout because it will render your text wrong
If I use more than one ExpandableTextView (as in list view) it only work for first entry, moreover we are not able to rename IDs (like expandable_text), so I cannot make unique IDs for another entries.
Tried this but with no success. Can someone provide a way to implement it? The expandable textview closes when I click on the link inside the expanded textview.
Tried this but with no success. Can someone provide a way to implement it? The expandable textview closes when I click on the link inside the expanded textview.
I had to import ExpandableTextView class and do some corrections in both ExpandListener and CollapseListener :
contentText.setText(Html.fromHtml(text)); contentText.setMovementMethod(LinkMovementMethod.getInstance());
in order to make links clickable.
Then in layout.xml i used: com.my.packagename.ExpandableTextView to load edited class instead of original one.
I am doing precisely that... going to recheck it and let you know. Thanks for helping me out!
I can do it on the textview while not expanded. But it didn´t work on the expanded text. Needed to also add to the xml element: android:linksClickable="true" android:autoLink="all"
Setting HTML text as a part of ExpandableTextView using (Html.fromHtml(String, int)) . when there are hyperlinks as a part of HTML content its display as a link. the clicking of that link will collapse the view instead of opening that in browser. Is the textview which is wrapped in ExpandableTextView (LinearLayout) is textview.setMovementMethod(LinkMovementMethod.getInstance()); ??