aporter / coursera-android-labs

Skeletons and Tests - Programming Mobile Applications for Android Handheld Systems
MIT License
354 stars 1.55k forks source link

Close file after read #6

Open ishaigor opened 9 years ago

ishaigor commented 9 years ago

This is to address the following stack in the lab 07-10 16:02:53.757 486-515/com.google.process.gapps E/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.(FileInputStream.java:80) at java.io.FileReader.(FileReader.java:42) at com.google.android.gms.gcm.GcmProvisioning.a(SourceFile:257) at com.google.android.gms.gcm.GcmProvisioning.a(SourceFile:195) at com.google.android.gms.gcm.GcmService.b(SourceFile:447) at com.google.android.gms.gcm.GcmService.onStartCommand(SourceFile:345) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2704) at android.app.ActivityThread.access$1900(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)