[Android] Handle progress in UI thread

Geoffrey Métais git at videolan.org
Tue Mar 17 13:30:44 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 17 13:21:44 2015 +0100| [55293f9a93e292c656a8714991331b0f642ca038] | committer: Geoffrey Métais

Handle progress in UI thread

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=55293f9a93e292c656a8714991331b0f642ca038
---

 .../tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java   |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 52f7170..3c6ccae 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -225,12 +225,22 @@ public class MainTvActivity extends Activity implements IVideoBrowser, OnItemVie
 
     @Override
     public void showProgressBar() {
-        mProgressBar.setVisibility(View.VISIBLE);
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mProgressBar.setVisibility(View.VISIBLE);
+            }
+        });
     }
 
     @Override
     public void hideProgressBar() {
-        mProgressBar.setVisibility(View.GONE);
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mProgressBar.setVisibility(View.GONE);
+            }
+        });
     }
 
     @Override



More information about the Android mailing list