[Android] Check context validity while browsing

Geoffrey Métais git at videolan.org
Wed Jun 22 18:10:07 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 22 18:04:10 2016 +0200| [bc6096b738f6537cb33a915e579dfa6d2b4874ad] | committer: Geoffrey Métais

Check context validity while browsing

(cherry picked from commit c603741919fe0048cc0c165374df079653c7c413)

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

 vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
index 00fe81f..d0baf9f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
@@ -110,10 +110,10 @@ public class FileBrowserFragment extends BaseBrowserFragment {
                     directory = new MediaWrapper(AndroidUtil.PathToUri(mediaDirLocation));
                     directory.setType(MediaWrapper.TYPE_DIR);
                     if (TextUtils.equals(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY, mediaDirLocation))
-                        directory.setDisplayTitle(getString(R.string.internal_memory));
+                        directory.setDisplayTitle(VLCApplication.getAppResources().getString(R.string.internal_memory));
                     mAdapter.addItem(directory, false, false);
                 }
-                if (mReadyToDisplay) {
+                if (mReadyToDisplay && context != null) {
                     context.runOnUiThread(new Runnable() {
                         @Override
                         public void run() {



More information about the Android mailing list