summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2013-09-21 11:33:58 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2013-09-21 11:33:58 +0200
commit4d50903182ec3839012408b34ddf8705f5b3ffb3 (patch)
tree1c8fb5d704338998f90b0215887b7e23c85d8b67 /src
parent03160e8f29dacdf59aec608cc9e24a1913a35d13 (diff)
downloadAntennaPod-4d50903182ec3839012408b34ddf8705f5b3ffb3.zip
Do not refresh description when receiving contentUpdate notification
Diffstat (limited to 'src')
-rw-r--r--src/de/danoeh/antennapod/activity/ItemviewActivity.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/de/danoeh/antennapod/activity/ItemviewActivity.java b/src/de/danoeh/antennapod/activity/ItemviewActivity.java
index 4b66fc81d..887fb1d76 100644
--- a/src/de/danoeh/antennapod/activity/ItemviewActivity.java
+++ b/src/de/danoeh/antennapod/activity/ItemviewActivity.java
@@ -5,7 +5,6 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
-import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
import android.text.format.DateUtils;
import android.util.Log;
@@ -14,7 +13,6 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window;
import android.widget.TextView;
-
import de.danoeh.antennapod.AppConfig;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.dialog.DownloadRequestErrorDialogCreator;
@@ -40,6 +38,7 @@ public class ItemviewActivity extends ActionBarActivity {
private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED | EventDistributor.DOWNLOAD_QUEUED;
private FeedItem item;
+ private boolean guiInitialized;
private AsyncTask<?, ?, ?> currentLoadTask;
@Override
@@ -52,6 +51,8 @@ public class ItemviewActivity extends ActionBarActivity {
EventDistributor.getInstance().register(contentUpdate);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ guiInitialized = false;
+
long itemId = getIntent().getLongExtra(
ItemlistFragment.EXTRA_SELECTED_FEEDITEM, -1);
if (itemId == -1) {
@@ -115,9 +116,18 @@ public class ItemviewActivity extends ActionBarActivity {
currentLoadTask = loadTask;
}
- private void populateUI() {
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- setContentView(R.layout.feeditemview);
+ private synchronized void populateUI() {
+ if (!guiInitialized) {
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ setContentView(R.layout.feeditemview);
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ FragmentTransaction fragmentTransaction = fragmentManager
+ .beginTransaction();
+ ItemDescriptionFragment fragment = ItemDescriptionFragment
+ .newInstance(item, false);
+ fragmentTransaction.replace(R.id.description_fragment, fragment);
+ fragmentTransaction.commit();
+ }
TextView txtvTitle = (TextView) findViewById(R.id.txtvItemname);
TextView txtvPublished = (TextView) findViewById(R.id.txtvPublished);
setTitle(item.getFeed().getTitle());
@@ -127,13 +137,7 @@ public class ItemviewActivity extends ActionBarActivity {
DateFormat.SHORT));
txtvTitle.setText(item.getTitle());
- FragmentManager fragmentManager = getSupportFragmentManager();
- FragmentTransaction fragmentTransaction = fragmentManager
- .beginTransaction();
- ItemDescriptionFragment fragment = ItemDescriptionFragment
- .newInstance(item, false);
- fragmentTransaction.replace(R.id.description_fragment, fragment);
- fragmentTransaction.commit();
+ guiInitialized = true;
}
@Override