Addendum to commit 30d7f269de to cancel the callbacks so they're not called after the fragment is detached. Closes #357

This commit is contained in:
Vavassor 2017-07-25 17:35:36 -04:00
parent 75847bd968
commit e5deac0fa9

View file

@ -138,7 +138,7 @@ public class ViewMediaFragment extends BaseFragment {
@Override
public void onError() {
// if there's no image in cache, load from network and start trnasition
// if there's no image in cache, load from network and start transition
// immediately.
photoActionsListener.onBringUp();
@ -153,6 +153,13 @@ public class ViewMediaFragment extends BaseFragment {
return rootView;
}
@Override
public void onDetach() {
super.onDetach();
Picasso.with(getContext())
.cancelRequest(photoView);
}
private void loadImageFromNetwork(String url, ImageView photoView) {
Picasso.with(getContext())
.load(url)