0

why high API level added method AutoCompleteTextView.setText(CharSequence, boolean) run on low API level device work well

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

in the doc said this method was Added in API level 17 but what device i had test:ZTE U880(2.2.2)API8, HuaWeiU8860(2.3.6) all work well

i want to known why?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Asion Tang
  • 41
  • 9
  • Likely you're not calling that method but some overload in a superclass. Post your code. – laalto Apr 27 '15 at 11:52
  • 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. – CommonsWare Apr 27 '15 at 12:02

1 Answers1

1

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    }
Community
  • 1
  • 1
Asion Tang
  • 41
  • 9