I have been developing an android app for a few weeks now and keep seeing this problem every now and again:
06-24 14:04:48.915 1530-1539/android.process.acore 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 android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
at android.os.Binder.execTransact(Binder.java:446)
The only thing I can think of that is causing this is that I open a url in the browser using this code:
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View textView) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.practiceadmin.com/legal/"));
browserIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(browserIntent);
}
};
The strange thing is when I open up my android.os.ParcelFileDescriptor.java file, it says that for the import statements:
import dalvik.system.CloseGuard;
import libcore.io.IoUtils;
import libcore.io.Memory;
it cannot resolve symbol 'CloseGaurd'/'libcore'. Any direction in solving this would be greatly appreciated.