[Android] Fix history row disappearing

Geoffrey Métais git at videolan.org
Fri Jul 20 16:20:44 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul 20 16:20:28 2018 +0200| [87128d75ce9449d5d3ba0fdcd9dba091f4ce2d81] | committer: Geoffrey Métais

Fix history row disappearing

> https://code.videolan.org/videolan/vlc-android/commit/87128d75ce9449d5d3ba0fdcd9dba091f4ce2d81
---

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 0b15b8f89..a1ec93617 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -185,8 +185,8 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
                             @Override
                             public void run() {
                                 final ListRow hist = updateHistory(history);
-                                if (hist != null) mRowsAdapter.add(Math.min(2, mRowsAdapter.size()), hist);
-                                else removeHistory();
+                                if (hist != null && mHistoryAdapter == null) mRowsAdapter.add(Math.min(2, mRowsAdapter.size()), hist);
+                                else if (hist == null&& mHistoryAdapter != null) removeHistory();
                             }
 
                             private void removeHistory() {
@@ -495,11 +495,8 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
             mHistoryAdapter.add(item);
             mHistoryIndex.put(item.getLocation(), i);
         }
-        if (createAdapter) {
-            final HeaderItem historyHeader = new HeaderItem(HEADER_HISTORY, getString(R.string.history));
-            return new ListRow(historyHeader, mHistoryAdapter);
-        }
-        return null;
+        final HeaderItem historyHeader = new HeaderItem(HEADER_HISTORY, getString(R.string.history));
+        return new ListRow(historyHeader, mHistoryAdapter);
     }
 
     private void updateBrowsers() {



More information about the Android mailing list