[Android] Clean adapter and do not close cursor too early
Geoffrey Métais
git at videolan.org
Tue Mar 10 17:48:55 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 10 16:48:49 2015 +0100| [9716761e0a8f8690cb481905af237800351004b2] | committer: Geoffrey Métais
Clean adapter and do not close cursor too early
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=9716761e0a8f8690cb481905af237800351004b2
---
vlc-android/src/org/videolan/vlc/gui/MainActivity.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index df3376d..7ccf33a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -825,10 +825,12 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
@Override
public boolean onQueryTextChange(String newText) {
- if (newText.length() < 3)
+ if (newText.length() < 3) {
+ mSearchView.getSuggestionsAdapter().swapCursor(null);
return false;
+ }
Cursor cursor = MediaDatabase.getInstance().queryMedia(newText);
- mSearchView.getSuggestionsAdapter().changeCursor(cursor);
+ mSearchView.getSuggestionsAdapter().swapCursor(cursor);
return true;
}
More information about the Android
mailing list