X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/905b68b4ec886cff35799c0e0604383d9f1d245b..1fbc44b5743380523af7999c072299aad79fb65b:/src/com/owncloud/android/ui/fragment/SearchFragment.java diff --git a/src/com/owncloud/android/ui/fragment/SearchFragment.java b/src/com/owncloud/android/ui/fragment/SearchFragment.java index 7fa955a5..12a73c29 100644 --- a/src/com/owncloud/android/ui/fragment/SearchFragment.java +++ b/src/com/owncloud/android/ui/fragment/SearchFragment.java @@ -22,12 +22,15 @@ package com.owncloud.android.ui.fragment; import android.accounts.Account; import android.app.Activity; +import android.app.SearchManager; +import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.SearchView; import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; @@ -43,7 +46,7 @@ import com.owncloud.android.datamodel.OCFile; * create an instance of this fragment. */ public class SearchFragment extends Fragment { - private static final String TAG = ShareFileFragment.class.getSimpleName(); + private static final String TAG = SearchFragment.class.getSimpleName(); // the fragment initialization parameters private static final String ARG_FILE = "FILE"; @@ -92,6 +95,14 @@ public class SearchFragment extends Fragment { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.search_users_groups_layout, container, false); + // Get the SearchView and set the searchable configuration + SearchView searchView = (SearchView) view.findViewById(R.id.searchView); + SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); + searchView.setSearchableInfo(searchManager.getSearchableInfo( + getActivity().getComponentName()) // assumes parent activity is the searchable activity + ); + searchView.setIconifiedByDefault(false); // do not iconify the widget; expand it by default + return view; }