java - java 的 href 链接

标签 java android

我的应用程序从在线服务器检索数据。如果我在应用程序中插入像 Hello 这样的服务器,如果您点击上方,则不会引导任何地方。为什么?这是来源

MyText = (TextView) this.findViewById(R.art.tit);
        Text = (TextView) this.findViewById(R.artic.text);
        String formattedText = db.getTesto();
        String formattedTitle = db.getTitolo();
        MyText.setText(Html.fromHtml(formattedTitle));
        Text.setText(Html.fromHtml(formattedText));

最佳答案

这是超链接的示例:

MyText = (TextView) this.findViewById(R.art.tit);
Text = (TextView) this.findViewById(R.artic.text);
tv1.setLayoutParams(textOutLayoutParams);
tv1.setText(Html.fromHtml("<a href=\""+ formattedText + "\">" + formattedTitle + "</a>"));
tv1.setClickable(true);
tv1.setMovementMethod (LinkMovementMethod.getInstance());
dialogLayout.addView(tv1);

关于java - java 的 href 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17825343/

相关文章:

java - 如何将元素从一维数组传递到二维数组

java - 使用在用户滚动时动态加载的 Jsoup 解析网站

java - 如何给Listview添加一个id

java - Install4j:在 CentOS 7 服务器中执行安装程序无法启动并出现异常

java - 为什么我在 Spring 收到此消息? "Neither BindingResult nor plain target object for bean name ' removedTeam'可作为请求属性“

android - 如何从 expo android 应用程序中删除核心功能(SMS 小区广播)

android - Cordova - 静态 HTML/JS/CSS 是否可以在可分发的设备特定文件中加密

android - Flutter 列表项随动画改变位置

java - Android WebView 中的 WebRTC 使用 NextRTC Spring Signaling Server

android - 关于跨平台项目中 Web 语言互操作性的问题