官方文档:https://developer.android.com/reference/android/widget/AutoCompleteTextView.html#setText(java.lang.CharSequence, boolean)

public void setText (CharSequence text, boolean filter)

Added in API level 17

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函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?的更多相关文章

  1. [翻译]Android官方文档 - 通知(Notifications)

    翻译的好辛苦,有些地方也不太理解什么意思,如果有误,还请大神指正. 官方文档地址:http://developer.android.com/guide/topics/ui/notifiers/noti ...

  2. .NET Framework 版本和依赖关系[微软官方文档]

    .NET Framework 版本和依赖关系 微软官方文档: https://docs.microsoft.com/zh-cn/dotnet/framework/migration-guide/ver ...

  3. Android 触摸手势基础 官方文档概览

    Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...

  4. Android 触摸手势基础 官方文档概览2

    Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...

  5. Google Android官方文档进程与线程(Processes and Threads)翻译

    android的多线程在开发中已经有使用过了,想再系统地学习一下,找到了android的官方文档,介绍进程与线程的介绍,试着翻译一下. 原文地址:http://developer.android.co ...

  6. Android 线性布局(LinearLayout)相关官方文档 - 指南部分

    Android 线性布局(LinearLayout)相关官方文档 - 指南部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用 ...

  7. Dapr 官方文档中文翻译 v1.5 版本正式发布

    作者:敖小剑 - Dapr Approver 经过 Dapr 中国社区十余位贡献者一个多月的努力,Dapr 官方文档中文翻译 v1.5 版本完成翻译和审校,正式发布并上线 Dapr 官网. 访问方式 ...

  8. Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分

    Android 线性布局(LinearLayout)相关官方文档 - 布局參数部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商 ...

  9. 【苦读官方文档】2.Android应用程序基本原理概述

    官方文档原文地址 应用程序原理 Android应用程序是通过Java编程语言来写.Android软件开发工具把你的代码和其它数据.资源文件一起编译.打包成一个APK文件,这个文档以.apk为后缀,保存 ...

随机推荐

  1. Java并发包中常用类小结(二)

    6.ThredPoolExecutor ThredPoolExecutor是基于命令模式下的一个典型的线程池的实现,主要通过一些策略实现一个典型的线程池,目前已知的策略有ThreadPoolExecu ...

  2. lintcode :最小路径和

    题目: 最小路径和 给定一个只含非负整数的m*n网格,找到一条从左上角到右下角的可以使数字和最小的路径. 样例   注意 你在同一时间只能向下或者向右移动一步 解题: 这个和求三角形的最小路径的差不多 ...

  3. lintcode:strStr 字符串查找

    题目: 字符串查找 字符串查找(又称查找子字符串),是字符串操作中一个很有用的函数.你的任务是实现这个函数. 对于一个给定的 source 字符串和一个 target 字符串,你应该在 source ...

  4. 【PHPsocket编程专题(理论篇)】初步理解TCP/IP、Http、Socket.md

    前言 我们平时说的最多的socket是什么呢,实际上socket是对TCP/IP协议的封装,Socket本身并不是协议,而是一个调用接口(API).那TCP/IP又是什么呢?TCP/IP是ISO/OS ...

  5. [@Controller]3 详解@CookieValue,@PathVariable,@RequestBody,@RequestHeader,@RequestParam

    [@Controller]3 详解@CookieValue,@PathVariable,@RequestBody,@RequestHeader,@RequestParam 转载:http://blog ...

  6. 汇编debug 截图

  7. C++仿函数(functor)详解

    C++仿函数(functor)详解 所谓的仿函数(functor),是通过重载()运算符模拟函数形为的类. 因此,这里需要明确两点: 1 仿函数不是函数,它是个类: 2 仿函数重载了()运算符,使得它 ...

  8. 受限波兹曼机导论Introduction to Restricted Boltzmann Machines

    Suppose you ask a bunch of users to rate a set of movies on a 0-100 scale. In classical factor analy ...

  9. c# webbrowser 随机点击链接

    HtmlElementCollection hec = webBrowser1.Document.All; ; i < hec.Count; i++) { if (hec[i].GetAttri ...

  10. jquery在线教程

    http://www.runoob.com/jquery/jquery-slide.htmlhttp://www.w3school.com.cn/jquery/http://www.phpstudy. ...