[Android] Do not save selected item for now

Geoffrey Métais git at videolan.org
Thu May 24 17:08:58 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May 24 15:30:59 2018 +0200| [a3efd1ce4b23029596e7793a03b2d47f095e8b46] | committer: Geoffrey Métais

Do not save selected item for now

Causes crash with groups, because a media group is too heavy

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

 .../src/org/videolan/vlc/gui/tv/browser/CategoriesFragment.kt    | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/CategoriesFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/browser/CategoriesFragment.kt
index e776540ff..2d43b763b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/CategoriesFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/CategoriesFragment.kt
@@ -38,7 +38,6 @@ import org.videolan.vlc.gui.tv.CardPresenter
 import org.videolan.vlc.gui.tv.TvUtil
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserFragmentInterface
 import org.videolan.vlc.util.Constants
-import org.videolan.vlc.util.Constants.SELECTED_ITEM
 import org.videolan.vlc.util.RefreshModel
 
 private const val TAG = "VLC/CategoriesFragment"
@@ -57,8 +56,7 @@ open class CategoriesFragment<T : RefreshModel> : BrowseSupportFragment(), OnIte
         // UI setting
         headersState = BrowseSupportFragment.HEADERS_HIDDEN
         brandColor = ContextCompat.getColor(activity!!, R.color.orange800)
-        if (savedInstanceState !== null) selecteditem = savedInstanceState.getParcelable<MediaWrapper>(SELECTED_ITEM)
-        else backgroundManager = BackgroundManager.getInstance(requireActivity())
+        if (savedInstanceState == null) backgroundManager = BackgroundManager.getInstance(requireActivity())
     }
 
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -76,11 +74,6 @@ open class CategoriesFragment<T : RefreshModel> : BrowseSupportFragment(), OnIte
         restart = true
     }
 
-    override fun onSaveInstanceState(outState: Bundle) {
-        super.onSaveInstanceState(outState)
-        if (this::selecteditem.isInitialized) outState.putParcelable(SELECTED_ITEM, selecteditem)
-    }
-
     override fun onItemSelected(itemViewHolder: Presenter.ViewHolder?, item: Any?, rowViewHolder: RowPresenter.ViewHolder?, row: Row?) {
         if (item === null) return
         selecteditem = item as MediaWrapper



More information about the Android mailing list