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:
parent
75847bd968
commit
e5deac0fa9
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue