HTML赢得';在我的Android项目中无法解释

HTML赢得';在我的Android项目中无法解释,android,Android,我面临着一个奇怪的问题,我无法用我在相关主题上找到的解决方案来解决这个问题。(通过StackOverflow或其他站点) 这是关于StackOverflow主题的总结: 所以我在问你。为什么这些解决方案在我的项目中都不起作用 我甚至试着用WebView代替我的TextView!娜达!(html标记似乎被忽略了) 这是我的文本视图: <TextView android:layout_height="wrap_content" android:layout_width="match_pare

我面临着一个奇怪的问题,我无法用我在相关主题上找到的解决方案来解决这个问题。(通过StackOverflow或其他站点)

这是关于StackOverflow主题的总结:

所以我在问你。为什么这些解决方案在我的项目中都不起作用

我甚至试着用WebView代替我的TextView!娜达!(html标记似乎被忽略了)

这是我的文本视图:

<TextView android:layout_height="wrap_content"
android:layout_width="match_parent" android:id="@+id/signupLinkText"
android:text="" android:gravity="center_horizontal"
android:clickable="true" android:layout_margin="5px"
android:layout_marginTop="10px" android:layout_marginBottom="10px"></TextView>
然后是必须在strings.xml中解释的html

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- ... -->
    <string name="lbl_not_yet_subscribed">To sign up to RESA Mobile, <strong>click here</strong> !</string>
</resources>

要注册RESA Mobile,请单击此处
谢谢你花时间读我的书

关于

这应该是可行的:

TextView textView = findViewById(R.id.signupLinkText);
textView.setText(Html.fromHtml(...put the HTML here...));

将html文件发布到您的网站上

这对我很有用:

 <TextView
        android:id="@+id/message" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:padding="5dip" 
        android:textColor="#FFFFFF" />


  TextView textView = (TextView) findViewById(R.id.message);
  textView.setMovementMethod(LinkMovementMethod.getInstance());
  String message = "Blah blah blah <a href=\"http://google.com\">Google Link</a> blah blah blah.";
  textView.setText(Html.fromHtml(message));

TextView TextView=(TextView)findViewById(R.id.message);
setMovementMethod(LinkMovementMethod.getInstance());
字符串消息=“诸如此类诸如此类。”;
setText(Html.fromHtml(message));

如果您不发布代码,我们如何帮助您?好的,我更新了我的帖子。非常感谢。非常感谢你!我太傻了,这是救我一命的双引号+1000供您参考,为了解决我的具体问题,(我的HTML字符串在strings.xml中),我刚刚用标记包围了我的HTML代码,并转义了“.”。结果是:
单击此处!]>
没有比这更棘手的了!谢谢你,布伦德尔;)!干杯
 <TextView
        android:id="@+id/message" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:padding="5dip" 
        android:textColor="#FFFFFF" />


  TextView textView = (TextView) findViewById(R.id.message);
  textView.setMovementMethod(LinkMovementMethod.getInstance());
  String message = "Blah blah blah <a href=\"http://google.com\">Google Link</a> blah blah blah.";
  textView.setText(Html.fromHtml(message));