-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This fetch instance has been closed. Create a new instance using the builder #659
Comments
I am getting same crash. Could you please check this. private fun downloadMedia(filePath: String) { com.tonyodev.fetch2.exception.FetchException: This fetch instance has been closed. Create a new instance using the builder. |
I think it's a serious issue. We are facing the same when we are trying to download back-to-back images. |
is there any update? |
Once a Fetch instance is closed It can no longer be used. When the activity is started check if fetch is closed by doing the following private Fetch fetch;
@Override
protected void onStart() {
super.onStart();
if (fetch == null || fetch.isClosed()) {
//create new fetch instance
final FetchConfiguration configuration = new FetchConfiguration.Builder(this).build();
fetch = Fetch.Impl.getInstance(configuration);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (fetch != null && !fetch.isClosed()) {
fetch.close();
}
fetch = null;
}
|
When i resume my activity, error is showing "com.tonyodev.fetch2.exception.FetchException: This fetch instance has been closed. Create a new instance using the builder", how to fix it?
The text was updated successfully, but these errors were encountered: