mirror of
https://github.com/tuskyapp/Tusky
synced 2024-12-26 00:34:02 +01:00
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
@ -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 New Issue
Block a user