[Android] TV: Prevent IllegalArgumentException

Geoffrey Métais git at videolan.org
Wed Mar 1 11:35:14 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar  1 11:34:32 2017 +0100| [03055d627016b3e9b26cde98558648545ae421bf] | committer: Geoffrey Métais

TV: Prevent IllegalArgumentException

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

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 1 +
 1 file changed, 1 insertion(+)

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 2d3d28c..56186a5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -495,6 +495,7 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
             mOtherAdapter.add(new CardPresenter.SimpleCard(ID_ABOUT, getString(R.string.about), getString(R.string.app_name_full)+" "+ BuildConfig.VERSION_NAME, R.drawable.ic_tv_icon_small));
             mOtherAdapter.add(new CardPresenter.SimpleCard(ID_LICENCE, getString(R.string.licence), R.drawable.ic_tv_icon_small));
             mRowsAdapter.add(new ListRow(miscHeader, mOtherAdapter));
+            mBrowseFragment.setSelectedPosition(Math.min(mBrowseFragment.getSelectedPosition(), mRowsAdapter.size()-1));
             mBrowseFragment.setAdapter(mRowsAdapter);
         }
     }



More information about the Android mailing list