Android 7.0 TextView点击事件无效修复方案
2024-08-29 11:25:04
public class PostTextView extends TextView {
private Handler handler = new Handler(Looper.getMainLooper());
public PostTextView(Context context) {
super(context);
}
public PostTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public PostTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean post(Runnable action) {
// FIXME: 2017/5/25 android 7.0以上post方法发生改变,导致点击事件无效
if(Build.VERSION.SDK_INT >= 24){
handler.post(action);
return true;
}
return super.post(action);
}
}
最新文章
- HttpWatch的时间分析
- javascript模板库jsrender for循环嵌套示例
- 6/13 Sprint2 看板和燃尽图
- FileWriter和FileReader简单使用
- CreateCompatibleDC与BitBlt 学习
- Javascript 错误捕获
- for name in loop Shell
- python常用绘图软件包记录
- tool
- linux 多线程基础1
- 工具-maya2014软件操作细节(持续更新……)
- strut1.X和spring整合的二种方法
- hibernate切换数据源
- 自适应滤波:奇异值分解SVD
- 修改User-Agent来伪装浏览器访问手机站点
- Spring_Aop的xml和注解的使用
- 【ASP.NET Core快速入门】(九) RoutingMiddleware介绍以及MVC引入
- 一些Cassandra+YCSB异常
- Sorting Algorithms
- C++基础知识:动态类型识别
热门文章
- vue开发东京买菜,全栈项目,前端django,带手机GPS精准定位,带发票系统,带快递系统,带微信/支付宝/花呗/银行卡支付/带手机号一键登陆,等等
- P1091 合唱队形(LIS)
- net core 踩坑记录
- 设计模式(二十一)——解释器模式(Spring 框架中SpelExpressionParser源码分析)
- Leetcode(886)-可能的二分法
- docker镜像拉取、运行、删除
- In_array()函数弱比较
- 深入理解gradle中的task
- 2021-2-16:请问你知道分布式设计模式中的Quorum思想么?
- input composition event All In One