stream is now available on Android API 21?

I have minSdkVersion == 21

Previously, when I tried to use stream, I got an error - you can't, available from version 24. In confirmation:

Https://stackoverflow.com/questions/39515035/is-it-possible-to-use-the-java-8-stream-api-on-android-api-24

I had to write long and miserable cycles. Today I tried stream again and everything worked!!!

Question: why would this be, perhaps there is information about support somewhere? Or Android-studio just blunted show error and on versions below 24 I will get crashes(I don't have a device to check)?

Author: user282446, 2019-02-13

1 answers

With the release of Android Studio 3, a lot has changed, but unfortunately for the use of streams, you still need minSdkVersion at least 24.

A full description of the available language constructs and APIs from Java 8 is here: https://developer.android.com/studio/write/java8-support#supported_features

Kotlin will help you get rid of long and miserable cycles :)

 3
Author: Eugene Krivenja, 2019-02-13 10:07:00