I've read this post here. But still I cannot run code containing Java 8 Stream API features like the following on minSdkVersion < 24.
List<Car> newCars = cars.stream()
.filter(s -> s.getColor().equals("red"))
.collect(Collectors.toList());
This doesn't run due to the error message
Call requires API level 24 (current min is 15): java.util.Collection#stream
So does someone know a solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…