我有这段代码
private void copyFile(File src, File dst) throws IOException {
FileChannel inChannel = new FileInputStream(src).getChannel();
FileChannel outChannel = new FileOutputStream(dst).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
}finally {
if(inChannel != null) {
inChannel.close();
}
outChannel.close();
}
}
Run Code Online (Sandbox Code Playgroud)
产生恼人的警告"尝试可以使用自动资源管理".问题是我不能使用Java 7 try-with-resources导致我的应用程序目标api级别14(如果我使用它会出错).有没有办法压制那令人讨厌的警告?
我需要我的朋友在不安装eclipse的情况下查看我的应用程序日志.什么是让他们从我的应用程序中查看日志的最简单/最快的方法?他们只需要安装android-sdk并运行monitor.bat吗?