[Android] revert 991ffc03eae1d170a2547aa5e0a39c5899dab618 and fix the real issue

Sébastien Toque git at videolan.org
Sat Jun 23 20:40:45 CEST 2012


android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sat Jun 23 20:40:37 2012 +0200| [a62f1194817cbc42318f417e1237ca204e28a9b6] | committer: Sébastien Toque

revert 991ffc03eae1d170a2547aa5e0a39c5899dab618 and fix the real issue

onCreate was firing an async call to updateList with a 250ms delay to wait for the view to be created.
It's wrong (there no garanty that the view will be created at the end of the delay),
and totaly useless, since we now call updateList in onViewCreated

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=a62f1194817cbc42318f417e1237ca204e28a9b6
---

 .../src/org/videolan/vlc/gui/audio/AudioListFragment.java    |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
index 49d9b26..7a39ba6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
@@ -80,8 +80,6 @@ public class AudioListFragment extends SherlockListFragment {
 
         mSongsAdapter = new AudioListAdapter(getActivity());
         setListAdapter(mSongsAdapter);
-
-        mHandler.sendEmptyMessageDelayed(MediaLibrary.MEDIA_ITEMS_UPDATED, 250);
     }
 
     public void onViewCreated(View view, Bundle savedInstanceState) {
@@ -262,13 +260,7 @@ public class AudioListFragment extends SherlockListFragment {
             mSongsAdapter.add(media);
         }
         mSongsAdapter.setCurrentIndex(currentIndex);
-        try {
-            getListView().setSelection(currentIndex);
-        } catch(IllegalStateException e) {
-            /* Happens if updateList() message is received before onCreateView()
-             * finishes. Nothing we can do here...
-             */
-        }
+        getListView().setSelection(currentIndex);
 
         mSongsAdapter.notifyDataSetChanged();
     }



More information about the Android mailing list