Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?
public void setText (CharSequence text, boolean filter)
Like setText(CharSequence)
, except that it can disable filtering.
Parameters
filter | If false , no filtering will be performed as a result of this call. |
---|
//官方文档标注为API.17才添加:public void setText(CharSequence text, boolean filter)
//Android Lint 是会检测到错误的!
//但是经过实际的机器测试中兴U880的2.2系统API8居然运行一切正常!很奇葩!
//为了以防万一,还是做一下异常处理
try
{
this.mCuurentView.setText(“something”, false);
}
catch (final Exception ex)
{
LogEx.e("setText(CharSequence text, boolean filter)果然报错了!", ex);
}
android - why high API level added method AutoCompleteTextView.setText(CharSequence, boolean) run on low API level device work well - Stack Overflow
http://stackoverflow.com/questions/29894904/why-high-api-level-added-method-autocompletetextview-settextcharsequence-boole/29958789#29958789
Another possibility is that the method had been in Android for some time, but was marked with
@hide and therefore was excluded from the Android SDK. Not every device before API Level 17 will necessarily have that method, as device manufacturers can change anything that is not part of the Android SDK. – CommonsWare2 days ago |
Thanks CommonsWare!
Android 2.2.3 Source Code Cross Reference: AutoCompleteTextView.java#setText
/**
967 * Like {@link #setText(CharSequence)}, except that it can disable filtering.
968 *
969 * @param filter If <code>false</code>, no filtering will be performed
970 * as a result of this call.
971 *
972 * @hide Pending API council approval.
973 */
974 public void setText(CharSequence text, boolean filter) {
975 if (filter) {
976 setText(text);
977 } else {
978 mBlockCompletion = true;
979 setText(text);
980 mBlockCompletion = false;
981 }
982 }
Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?的更多相关文章
- [翻译]Android官方文档 - 通知(Notifications)
翻译的好辛苦,有些地方也不太理解什么意思,如果有误,还请大神指正. 官方文档地址:http://developer.android.com/guide/topics/ui/notifiers/noti ...
- .NET Framework 版本和依赖关系[微软官方文档]
.NET Framework 版本和依赖关系 微软官方文档: https://docs.microsoft.com/zh-cn/dotnet/framework/migration-guide/ver ...
- Android 触摸手势基础 官方文档概览
Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...
- Android 触摸手势基础 官方文档概览2
Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...
- Google Android官方文档进程与线程(Processes and Threads)翻译
android的多线程在开发中已经有使用过了,想再系统地学习一下,找到了android的官方文档,介绍进程与线程的介绍,试着翻译一下. 原文地址:http://developer.android.co ...
- Android 线性布局(LinearLayout)相关官方文档 - 指南部分
Android 线性布局(LinearLayout)相关官方文档 - 指南部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用 ...
- Dapr 官方文档中文翻译 v1.5 版本正式发布
作者:敖小剑 - Dapr Approver 经过 Dapr 中国社区十余位贡献者一个多月的努力,Dapr 官方文档中文翻译 v1.5 版本完成翻译和审校,正式发布并上线 Dapr 官网. 访问方式 ...
- Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分
Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商 ...
- 【苦读官方文档】2.Android应用程序基本原理概述
官方文档原文地址 应用程序原理 Android应用程序是通过Java编程语言来写.Android软件开发工具把你的代码和其它数据.资源文件一起编译.打包成一个APK文件,这个文档以.apk为后缀,保存 ...
随机推荐
- cogs 自己出的题目 题解报告
第一题很简单嘛,就是裸的动态树分治嘛 对于每一层的重心维护子树路径的信息和子树到上一层重心的点的信息 空间复杂度O(nlogn) 对于每一层我们按dis排序,之后记录军队数量的前缀和 查询的时候我们只 ...
- Java学习笔记(一) java介绍
编程语言分为:编译型语言和解释型语言. 编译型语言需要经过特定编译器通过一次性编译,成为该特定平台硬件可执行的机器码,可脱离开发环境独立运行,运行效率较高,但是无法跨平台移植. 解释型语言需要经过特定 ...
- 应用程序出现挂死,.NET Runtime at IP 791F7E06 (79140000) with exit code 80131506.
工具出现挂死问题 1.问题描述 工具出现挂死问题,巡检IIS发现以下异常日志 现网系统日志: 事件类型: 错误 事件来源: .NET Runtime 描述: Application: Di ...
- [iOS]iPhone进行真机测试(基础版)
买完688个人开发者账号之后,如何进行真机测试呢??看下面 1.打开https://developer.apple.com 然后,输入我们买过688点那个App ID帐号和密码哦!!一定是要支付过的! ...
- 69. Sqrt(x)
题目: Implement int sqrt(int x). Compute and return the square root of x. 链接: http://leetcode.com/pr ...
- java对称加密报错:Input length must be multiple of 8 when decrypting with padded cipher
HTTP Status 500 - Request processing failed; nested exception is javax.crypto.IllegalBlockSizeExcept ...
- 2008年我买了一本书 书名叫“PHP 6”
上个星期天,我感觉应该整理一下我的书柜.于是,在书柜里,我发现了一本几乎完全忘记的书(我想不起来为什么要买它!):<PHP 6 – 快速简洁的Web开发> 这本书出版于2008年一月.而六 ...
- PHP无限极分类生成树方法
你还在用浪费时间又浪费内存的递归遍历无限极分类吗,看了该篇文章,我觉得你应该换换了.这是我在OSChina上看到的一段非常精简的PHP无限极分类生成树方法,整理分享了. function genera ...
- [HDOJ2473]Junk-Mail Filter(并查集,删除操作,马甲)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2473 给两个操作:M X Y:将X和Y看成一类. S X:将X单独划归成一类. 最后问的是有多少类. ...
- Mac下安装HBase及详解
Mac下安装HBase及详解 1. 千篇一律的HBase简介 HBase是Hadoop的数据库, 而Hive数据库的管理工具, HBase具有分布式, 可扩展及面向列存储的特点(基于谷歌BigTabl ...