[英]Android: java method type API level 25, cause issue if not called?
This class is shared between java and android. 此类在java和android之间共享。
public class Foo {
....
javax.sql.DataSource getDataSource() {
....
}
}
The DataSource class on android requires API level 25. But the method getDataSource() will not be called on android. android上的DataSource类需要API级别25。但是在Android上不会调用getDataSource()方法。 Will this cause problem on android with API level < 25?
这会在API级别<25的android上引起问题吗?
This will not make any error on compiling time. 这不会在编译时出错。 So in my opinion if you never use it, it won't cause problem.
因此,我认为,即使您从不使用它,也不会造成问题。
Erase never called code, but no, there's no RuntimeExceptions if you DON'T call newer API codes trough code. 擦除从未调用过的代码,但是,如果您不调用较新的API代码通过代码,则不会有RuntimeExceptions。
Please note, that when implementing interfaces the API may try to use the methods for you. 请注意,在实现接口时,API可能会尝试为您使用这些方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.