[Android] SearchFragment: fix a crash with old APIs

Adrien Maglo git at videolan.org
Sat Mar 1 16:31:29 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Sat Mar  1 16:31:16 2014 +0100| [c50ea3b3b8d8e063f2824b5fcac6d73c7fd93bb2] | committer: Adrien Maglo

SearchFragment: fix a crash with old APIs

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

 vlc-android/src/org/videolan/vlc/gui/SearchFragment.java |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java b/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
index f31d4e4..166d1d0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchFragment.java
@@ -30,9 +30,10 @@ import org.videolan.vlc.MediaLibrary;
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.video.VideoPlayerActivity;
 
+import com.actionbarsherlock.app.SherlockListFragment;
+
 import android.content.Context;
 import android.os.Bundle;
-import android.support.v4.app.ListFragment;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.view.KeyEvent;
@@ -46,7 +47,7 @@ import android.widget.ListView;
 import android.widget.TextView;
 import android.widget.TextView.OnEditorActionListener;
 
-public class SearchFragment extends ListFragment {
+public class SearchFragment extends SherlockListFragment {
 
     public final static String TAG = "VLC/SearchActivit";
 
@@ -57,7 +58,7 @@ public class SearchFragment extends ListFragment {
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        getActivity().getActionBar().setTitle(getResources().getString(R.string.search));
+        getSherlockActivity().getSupportActionBar().setTitle(R.string.search);
 
         View v = inflater.inflate(R.layout.search, container, false);
 



More information about the Android mailing list