TextView 中添加超链接
"点击确认即表示您同意并签署《管理服务协议》及《风险提示书》");
int firsStar = spanableInfo.toString().indexOf("《");
int firstEnd = spanableInfo.toString().indexOf("》");
int end = spanableInfo.length();
// 1-管理服务协议页面; 2-金风险提示书页面
spanableInfo.setSpan(new Clickable( 1), firsStar, firstEnd,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
spanableInfo.setSpan(new Clickable(2), firstEnd + 2, end,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tvZybInputDesc.setText(spanableInfo);
tvZybInputDesc.setMovementMethod(LinkMovementMethod.getInstance());
// 1-跳转到投资咨询及管理服务协议页面; 2-挑战到投资资金风险提示书页面
private int type;
super();
this.type = type;
}
public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(getResources().getColor(R.color.text_gray_color));
ds.setUnderlineText(false);
}
public void onClick(View v) {
String userId = ConfigTools.getConfigValue(Constants.USER_ID, "");
String token = PageUtils.getTokenUtf8();
Intent sIntent = new Intent(ZybInputActivity.this, SszWebviewActivity.class);
if (type == 1) {
//处理管理服务协议的点击事件
// 处理风险提示书的点击事件
}
startActivity(sIntent);
}
}
TextView 中添加超链接的更多相关文章
- android中用Spannable在TextView中设置超链接、颜色、字体
昨晚研读 ApiDemo 源码至 com.example.android.apis.text.Link 类.首先,看一下其运行效果: 要给 TextView 加上效果,方式主要有几种: 第一种,自动 ...
- django web 中添加超链接
django web 中添加不传参的超链接的方法如下: html: 在web中的超链接中加入一下url <a href="{% url 'app_name.views.url_func ...
- Java 在PDF 中添加超链接
对特定元素添加超链接后,用户可以通过点击被链接的元素来激活这些链接,通常在被链接的元素下带有下划线或者以不同的颜色显示来进行区分.按照使用对象的不同,链接又可以分为:文本超链接,图像超链接,E-mai ...
- C#在excel中添加超链接
1.新建一个项目 2.给项目添加引用:Microsoft Excel 12.0 Object Library (2007版本) using Excel = Microsoft.Office.Inter ...
- VUE-001-在表格单元格(el-table-column)中添加超链接访问
在进行前端网页开发时,通常列表数据我们使用table展示.那么如何在 el-table-column 单元格中使用超链接呢? 如下即是解决方式的一种: 仅需要将如下代码: <el-table-c ...
- 在RichTextBox控件中添加超链接文本
实现效果: 知识运用: RichTextBox控件的AppendText方法 public void AppendText{string textData} //向控件中添加文本内容 和Process ...
- Android 为 TextView 添加超链接 (网址,邮件,电话)
<string name="info">Cette application a été développée par <a href="http://w ...
- TextView中超链接拦截
TextView中的超链接点击时,其实是通过Intent方式的,因此会调用Activity中的startActivity(Intent intent)方法,所以可在此方法中做些简单的拦截操作 例如拦截 ...
- Android开发:TextView添加超链接的简便方法
TextView中加入超链接的方式很多,但下面的方式应该的最简便合理的 strings.xml中定义字串 <string name="blog"><a href= ...
随机推荐
- RABBITMQ/JAVA (主题)
上篇博文中,我们进一步改良了日志系统.即使用Direct类型的转换器,使得接受者有能力进行选择性的接收日志,而非fanout那样,只能够无脑的转发. 虽然使用Direct类型的转换器改进了日志系统.但 ...
- POJ 1236 SCC+缩点
题意:一张有向图,一问至少给几个点发送软件,才能让所有点都能收到软件:二问是至少添加几条边才能让整个图是一个连通分量: 分析:一般求连通分量都会求缩点,在这里缩点之后,生成一张新的图,在新的图中求每一 ...
- html table动态合并单元格 js方法
<script> $(document).ready(function(){ function mc(tableId, startRow, endRow, col) { var tb = ...
- Conntect Bluetooth devices in iOS.
I understand that the External Accessory framework in iOS 3.0 and later will allow my application to ...
- WampServe修改默认网站目录的方法(转)
1wamp简介 WampServe集成了Apache.MySQL.PHP.phpmyadmin,支持Apache的mod_rewrite,PHP扩展.Apache模块只需要在菜单“开启/关闭”上点点就 ...
- maven 基本常识以及命令
Maven库: http://repo2.maven.org/maven2/ Maven依赖查询: http://mvnrepository.com/ Maven常用命令: 1. 创建Maven的普通 ...
- python 的内嵌time模板翻译及说明[转]
一.简介 time模块提供各种操作时间的函数 说明:一般有两种表示时间的方式: 第一种是时间戳的方式(相对于1970.1.1 00:00:00以秒计算的偏移量),时间戳是惟一的 ...
- Windows下启动,关闭Nginx命令
启动 直接点击Nginx目录下的nginx.exe 或者 cmd运行start nginx 关闭 nginx -s stop 或者 nginx -s quit stop表示立即 ...
- Android Hotpatch系列之-项目介绍
给现实Android apk打补丁,不用强迫客户升级客户端,悄悄的就把bug修复了,程序猿再也不用被老大骂娘了. 客户端例子实现:https://github.com/fengcunhan/Hotpa ...
- unity, 播放循环背景音乐注意事项
循环背景音乐用wav格式,不要用mp3. 参考:http://answers.unity3d.com/questions/343057/how-do-i-make-unity-seamlessly-l ...