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

问题描述 投票:0回答:1

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

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

在doc中说这个方法是在API级别17中添加但我测试的设备是什么:中兴通讯U880(2.2.2)API8,华为U8860(2.3.6)都运行良好

我想知道为什么?

android autocompletetextview android-api-levels
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    }
© www.soinside.com 2019 - 2024. All rights reserved.