diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-01-21 13:03:30 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-01-21 13:03:30 +0100 |
commit | 595674a8724c7b74b2087a728a2576ed01c3cc0f (patch) | |
tree | 1019034e25b9aa1c59173939f92e224df5939842 /app/src | |
parent | a6c33d3b2c2408b914bbb7a9a1309c1f98662f24 (diff) | |
download | AntennaPod-595674a8724c7b74b2087a728a2576ed01c3cc0f.zip |
Minor refactorings
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java index 5e182d39e..f3ed1cb62 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java @@ -160,7 +160,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE); prefs.edit() .putInt(PREF_KEY_SELECTED_FRAGMENT_POSITION, pager.getCurrentItem()) - .commit(); + .apply(); } @Override @@ -242,7 +242,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close); drawerToggle.setDrawerIndicatorEnabled(false); - drawerLayout.setDrawerListener(drawerToggle); + drawerLayout.addDrawerListener(drawerToggle); navAdapter = new NavListAdapter(itemAccess, this); navList.setAdapter(navAdapter); @@ -396,12 +396,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem new RenameFeedDialog(this, feed).show(); return true; case R.id.remove_item: - final FeedRemover remover = new FeedRemover(this, feed) { - @Override - protected void onPostExecute(Void result) { - super.onPostExecute(result); - } - }; + final FeedRemover remover = new FeedRemover(this, feed); ConfirmationDialog conDialog = new ConfirmationDialog(this, R.string.remove_feed_label, getString(R.string.feed_delete_confirmation_msg, feed.getTitle())) { @@ -413,7 +408,8 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem Playable playable = controller.getMedia(); if (playable != null && playable instanceof FeedMedia) { FeedMedia media = (FeedMedia) playable; - if (media.getItem().getFeed().getId() == feed.getId()) { + if (media.getItem() != null && media.getItem().getFeed() != null && + media.getItem().getFeed().getId() == feed.getId()) { Log.d(TAG, "Currently playing episode is about to be deleted, skipping"); remover.skipOnCompletion = true; if(controller.getStatus() == PlayerStatus.PLAYING) { |