Dispose loaders before setting controller to null
This commit is contained in:
parent
4ddee03214
commit
426be4d226
|
@ -93,17 +93,12 @@ public class ChaptersFragment extends Fragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
controller.release();
|
||||
controller = null;
|
||||
EventBus.getDefault().unregister(this);
|
||||
|
|
|
@ -128,6 +128,10 @@ public class CoverFragment extends Fragment {
|
|||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
controller.release();
|
||||
controller = null;
|
||||
EventBus.getDefault().unregister(this);
|
||||
|
@ -203,15 +207,6 @@ public class CoverFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
void onPlayPause() {
|
||||
if (controller == null) {
|
||||
return;
|
||||
|
|
|
@ -66,9 +66,6 @@ public class ItemDescriptionFragment extends Fragment {
|
|||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Log.d(TAG, "Fragment destroyed");
|
||||
if (webViewLoader != null) {
|
||||
webViewLoader.dispose();
|
||||
}
|
||||
if (webvDescription != null) {
|
||||
webvDescription.removeAllViews();
|
||||
webvDescription.destroy();
|
||||
|
@ -168,6 +165,10 @@ public class ItemDescriptionFragment extends Fragment {
|
|||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
if (webViewLoader != null) {
|
||||
webViewLoader.dispose();
|
||||
}
|
||||
controller.release();
|
||||
controller = null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue