[Android] Avoid crash in SearchFragment
Jean-Baptiste Kempf
git at videolan.org
Sun Apr 6 18:19:49 CEST 2014
vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 6 18:18:56 2014 +0200| [42a51db09c46b88081e7c32d4320d20648dd9145] | committer: Jean-Baptiste Kempf
Avoid crash in SearchFragment
It seems weird that this happen, but maybe a race on creation and
onSearchKeyPressed() call
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=42a51db09c46b88081e7c32d4320d20648dd9145
---
vlc-android/src/org/videolan/vlc/gui/SearchFragment.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java b/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
index 166d1d0..e08b2df 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
@@ -224,6 +224,8 @@ public class SearchFragment extends SherlockListFragment {
};
public void onSearchKeyPressed() {
+ if (mSearchText == null)
+ return;
mSearchText.requestFocus();
mSearchText.setSelection(mSearchText.getText().length());
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
More information about the Android
mailing list