diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 11:23:16 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 11:23:16 +0000 |
commit | 037223e28666f2d9294a5b587af35094df1121e3 (patch) | |
tree | 8451098bca79667d10f24c1b2a94b8dcacdec63c /app/src/main/java/ml | |
parent | 03f8741f3d3d3c9c581c7d7c3a6901a3492d5240 (diff) | |
download | infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar.gz infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar.bz2 infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar.lz infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar.xz infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.tar.zst infinity-for-reddit-037223e28666f2d9294a5b587af35094df1121e3.zip |
Unregister EventBus listener in onDestroy in TrendingActivity and RPANActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java | 7 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java index 76ec456b..5d2d47f4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java @@ -30,6 +30,7 @@ import com.evernote.android.state.State; import com.google.android.material.snackbar.Snackbar; import com.livefront.bridge.Bridge; +import org.greenrobot.eventbus.EventBus; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -350,6 +351,12 @@ public class RPANActivity extends AppCompatActivity { return false; } + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + private void shareLink(String link) { try { Intent intent = new Intent(Intent.ACTION_SEND); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java index fa9ac0f0..db550a4f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/TrendingActivity.java @@ -294,6 +294,12 @@ public class TrendingActivity extends BaseActivity { } @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Override protected SharedPreferences getDefaultSharedPreferences() { return mSharedPreferences; } |