Android TextView不会显示来自html的所有超链接

时间:2015-07-08 04:13:08

标签: android textview

我得到了TextView下一个礼节:

<TextView
                android:textColorLink="#083450"
                android:id="@+id/article_content"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#000000"
                android:textSize="15sp" />

在这个TextView我在字符串中加载下一个html:

<p style=&quot;&quot;>The study, led by researchers of the ATLANTES Research Programme, Institute for Culture and Society, University of Navarra, has been published in the Journal of Pain and Symptom Management. </p> 
<p style=&quot;&quot;>Eduardo Garralda, one of the study authors, said: “Lack of palliative medicine education has been consistently identified as a barrier to the development of palliative care in Europe and elsewhere. </p> 
<p style=&quot;&quot;>“International institutions have lobbied for the integration of palliative care into undergraduate medical curricula. However, a descriptive and comparative study on undergraduate palliative medicine education had not yet been undertaken. The current research is a good starting point to get a picture of Europe´s situation in this regard.”</p> 
<p style=&quot;&quot;>To assess the status of this discipline´s teaching, the investigators used a numerical scoring system according to three factors: </p> 
<p>1. the proportion of medical faculties teaching palliative medicine<br />2. the proportion of medical faculties teaching palliative medicine as a compulsory subject; and<br />3. the total number of palliative medicine teachers.</p> 
<p style=&quot;&quot;>According to the research, in 13 of the analysed countries, palliative medicine is taught in all medical faculties, but in only six it is mandatory. </p> 
<p style=&quot;&quot;>In 15 countries, it is only taught in some universities and in 14 there is not any sort of specific training on the topic. </p> 
<p style=&quot;&quot;>Israel, Norway, United Kingdom, Belgium, France, Austria, Germany and Ireland seem to be the countries where palliative medicine education is most developed.</p> 
<p style=&quot;&quot;>The research was carried out by José Miguel Carrasco, Eduardo Garralda, Kathrin Woitha and Carlos Centeno from the ATLANTES Research Programme based at the University of Navarra, in collaboration with other members of the EAPC Steering Committee for Pallaitve Medicine education: Frank Elsner, Palliative Care department of the RWTH Aachen University (Germany); Marilène Filbet, Marie Curie Institute for palliative care and from the Academic University Hospital  Lyon Sud HCL (France); John E. Ellershaw, University of Liverpool (United Kingdom); David Clark, Glasgow University – Dumfries campus; and Thomas J. Lynch, Kimmer Cancer Center of the Johns Hopkins University (United States).</p> 
<p style=&quot;&quot;>The authors concluded that, although palliative medicine appears in a substantial number of undergraduate medical programmes in European universities and a “qualified teaching structure” is arising; it is also clear that there is a great difference in palliative medicine education amongst the diverse countries. </p> 
<p style=&quot;&quot;>This research speaks to a topical theme and will be of general interest. The results will be of particular interest to palliative care professionals, future physicians as well as all agents involved in medical education (universities themselves, deans, faculty directors, professors, etc.) in Europe and worldwide.  Mr Garralda said: “My opinion, and that of my co-authors, is that the lack of palliative medicine education affects doctors greatly. They have less chance to develop appropriate interprofessional teamwork skills, as well as skills in symptom management, psychological and spiritual issues, and communication. In addition, palliative medicine students surveyed have said they consider it essential for their development as physicians.” </p> 
<p style=&quot;&quot;>The study, <a href=&quot;http://www.jpsmjournal.com/article/S0885-3924%2815%2900241-9/pdf&quot;>Palliative Care Medical Education in European Universities: A Descriptive Study and Numerical Scoring System Proposal for Assessing Educational Development</a> can be accessed online. </p> 
<p style=&quot;&quot;><em><strong>Have you been involved in new and exciting research relevant to hospice and palliative care? Email Kate at <a href=&quot;mailto:name@example.com&quot;>name@example.com</a> to share your news on .</strong></em></p>

对于此负载,我使用下一个代码行(content是上面的字符串):

textView.setText(Html.fromHtml(content));
textView.setMovementMethod(LinkMovementMethod.getInstance());

我的问题是为什么只显示1个超链接而不是2。

1 个答案:

答案 0 :(得分:0)

将此属性android:autoLink="web"添加到XML文件的TextView中 您可以在此处看到更多值android:autoLink
+ setAutoLinkMask