aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-12-02 09:09:01 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-12-02 09:09:01 +0000
commit95fd7ce8baf0f4bf1eea12282e570cadb01860ce (patch)
tree133a4a13a527037719f254e1767a02813201e0a2 /app/src/main
parentc213cc0962c13cd8450ea1be89775c40dc7f7f15 (diff)
downloadinfinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar.gz
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar.bz2
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar.lz
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar.xz
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.tar.zst
infinity-for-reddit-95fd7ce8baf0f4bf1eea12282e570cadb01860ce.zip
Try fixing ANR when releasing ExoPlayer.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java2
4 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java
index fb9bca66..b2b28948 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java
@@ -635,6 +635,8 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF
protected void onDestroy() {
EventBus.getDefault().unregister(this);
super.onDestroy();
+ player.seekToDefaultPosition();
+ player.stop(true);
player.release();
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
index 66bd7b73..df48ab26 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
@@ -397,6 +397,8 @@ public class ViewVideoActivity extends AppCompatActivity {
@Override
protected void onDestroy() {
super.onDestroy();
+ player.seekToDefaultPosition();
+ player.stop(true);
player.release();
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
index e95306bb..3af97f85 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
@@ -278,6 +278,8 @@ public class ViewImgurVideoFragment extends Fragment {
@Override
public void onDestroy() {
super.onDestroy();
+ player.seekToDefaultPosition();
+ player.stop(true);
player.release();
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
index e2d16f22..9530823d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
@@ -282,6 +282,8 @@ public class ViewRedditGalleryVideoFragment extends Fragment {
@Override
public void onDestroy() {
super.onDestroy();
+ player.seekToDefaultPosition();
+ player.stop(true);
player.release();
}