title: SearchView is not working in fragment
body: <p>i am trying to implement a searchView function in fragment. The searchView is in a custom action bar this is the code i used but it is not working. If i move the searchview to the fragment layout it works, but it doesnt work in action bar.</p>
  
  <pre><code>public class TabActivity_adbya extends Fragment implements View.OnTouchListener,AdapterView.OnItemClickListener {
  
  
      GridView gridView;
      FirebaseDatabase firebaseDatabaseInstance;
      private DatabaseReference booksInstance;
      SearchView sv;
  
      AlbumDBHandler db;
      ArrayList&lt;mokdmatData&gt; books = new ArrayList&lt;&gt;();
      maKotabAdapter adapter;
  
  
      @Override
      public View onCreateView(final LayoutInflater inflater, final ViewGroup container, Bundle savedInstancestate) {
  
          final View rootView = inflater.inflate(R.layout.activity_tab_adbya,container,false);
  
          ((makalat2) getActivity()).getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
          ((makalat2) getActivity()).getSupportActionBar().setCustomView(R.layout.abs_layout);
          ((makalat2) getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(true);
          TextView textViewTitle = (TextView) getActivity().findViewById(R.id.mytext);
          textViewTitle.setText("Articles");
  
  
          sv = (SearchView) getActivity().findViewById(R.id.svZelal);
          sv.setQueryHint("Search...");
  
          sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
  
              @Override
              public boolean onQueryTextSubmit(String query) {
                  return false;
              }
              @Override
              public boolean onQueryTextChange(String query) {
                  adapter.getFilter().filter(query);
                  return true;
              }
          });
  
  
          gridView = (GridView) rootView.findViewById(R.id.gridView_adbya);
          gridView.setOnItemClickListener(this);
  
          db = new AlbumDBHandler(getActivity());
          getData();
          init();
  
          return rootView;
      }
  </code></pre>
  
  <p>This is the custom action bar i am using </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          android:weightSum="3"
         &gt;
          &lt;ImageView
              android:layout_width="0dp"
              android:layout_height="22dp"
              android:src="@drawable/homebutton"
              android:layout_gravity="center"
              android:layout_weight="0.40"
              android:id="@+id/homeButton"
              /&gt;
          &lt;Space
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.60"
              /&gt;
      &lt;com.mediamer.metwally.saidkotb.helpers.CustomTextView
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:gravity="center"
          android:textColor="@color/TextColor"
          android:id="@+id/mytext"
          android:textSize="25sp"
          android:layout_weight="1"
          /&gt;
          &lt;Space
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.60"
              /&gt;
  
              &lt;android.support.v7.widget.SearchView
              android:id="@+id/svZelal"
              android:layout_width="0dp"
              android:searchIcon="@android:drawable/ic_menu_search"
              android:layout_height="match_parent"
              android:layout_weight="0.40"
              /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>