Why is some kind of Android code running at a previous API level than it should?

I am developing an Android application that, among other things, uses the toLongArray method from java.BitSet. As you can see here , this method was introduced in the Android API level 19, Android 4.4. Lint in Eclipse correctly warns me about this because my minSdkVersion is 10, but I can configure it so that it doesn't complain.

With this, I could create a project and run it: in Android 5.0, it works in Android 2.3 (API level 10), but this is not surprising in Android 4.0.3, 4.1.2, 4.2 (which are below API level 19), it works like a charm, although it should not work. The same thing happens even if I set min / target sdk to 15 (Android 4.0.3).

The same thing happens for Object.hashCode, and I cannot understand why it works.

+4
source share
1 answer

In fact, it really surprised me.

I went to their store to see what the hell this is. So I found that they add some methods, but hide them in the documentation using the @hide javadoc annotation until it is fully tested, or until they remember it.

@hide When applied to a package, class, method or field, @hide removes that node and all its children from the documentation.

, toLongArray() 3 10 , 1 , 7 commit.

+4

Source: https://habr.com/ru/post/1568350/


All Articles