Home » Android » java – How to list-up all Classes that “close()“ were added from API level 24-Exceptionshub

java – How to list-up all Classes that “close()“ were added from API level 24-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I had a problem using try-with-resource for MediaMetadataRetriever.

My app was running on api-29 device, but not under api28.

It turned out this is because close() is added in API level 29.

TargetSdk: 29
CompileSdk: 29
MinSdk: 23

Since I cannot test all devices with different api levels, from 23 to 29.
What should I do to avoid this kind of problem?

I tried to list up all Classes that close() were added from API level 24.
But I don’t know how to do it.

How to&Answers: