0

为什么高 API 级别添加的方法 AutoCompleteTextView.setText(CharSequence, boolean) 在低 API 级别设备上运行良好

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

在文档中说此方法是在 API 级别 17 中添加的,但我测试的设备是:ZTE U880(2.2.2)API8、HuaWeiU8860(2.3.6) 都运行良好

我想知道为什么?

4

1 回答 1

1

感谢CommonsWare

Android 2.2.3 源代码交叉参考: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    }
于 2015-04-30T04:03:31.587 回答