You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class MyApplication extends Application{
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
enableStrictMode();
}
}
private void enableStrictMode() {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDialog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll()
.penaltyLog()
.build());
}
}
LogCat output
StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at java.io.FileInputStream.<init>(FileInputStream.java:78)
at net.gotev.uploadservice.schemehandlers.FileSchemeHandler.getInputStream(FileSchemeHandler.java:32)
at net.gotev.uploadservice.UploadFile.getStream(UploadFile.java:68)
at net.gotev.uploadservice.BinaryUploadTask.onBodyReady(BinaryUploadTask.java:23)
at net.gotev.uploadservice.okhttp.OkHttpStackConnection$1.writeTo(OkHttpStackConnection.java:107)
Additional info
close method should be called for InputStream
The text was updated successfully, but these errors were encountered:
What did you expect?
No StrictMode warnings
What happened instead?
Strict mode warning about not closed input stream
Version info
Steps to reproduce (if applicable):
Enable StrictMode:
LogCat output
Additional info
close method should be called for InputStream
The text was updated successfully, but these errors were encountered: