I'm running into an issue similar to this one, except with java.util.Scanner
. I have this static method:
public static void close(final Closeable c) {
if(c != null) {
Log.debug(TAG, "instance of " + c.getClass().getName());
try {
c.close();
} catch (IOException e) {
// ignore
}
}
}
When passed a Scanner
on API 15, it crashes like so:
08-29 20:33:42.979: E/AndroidRuntime(2245): FATAL EXCEPTION: main
08-29 20:33:42.979: E/AndroidRuntime(2245): java.lang.IncompatibleClassChangeError: interface not implemented
08-29 20:33:42.979: E/AndroidRuntime(2245): at com.mycompany.myapp.IOUtil.close(IOUtil.java:36)
[more lines omitted]
The docs say that Scanner
implements Closeable
even if you set the doc API level below 15. Could this be a vendor-specific issue? I only have one API 15 device to test on, and nothing between that and API 19, which works fine.