title: Cannot instantiate class: android.support.v7.widget.SearchView
body: <p>I´m trying to use a <code>SearchView</code> for my Application. First i added <code>appcompat</code> to my project:</p>
  
  <pre><code> compile "com.android.support:appcompat-v7:19.0.1+"
  </code></pre>
  
  <p>secound i add this code to my menu:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:id="@+id/action_search"
      android:title="@string/search"
      android:icon="@drawable/ic_action_search"
      android:showAsAction="ifRoom|collapseActionView"
      android:actionViewClass="android.support.v7.widget.SearchView" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>but when i start the <code>activity</code> i get this: </p>
  
  <blockquote>
    <p>03-07 17:25:39.110  16861-16861/de.treevo.app W/MenuInflater﹕ Cannot
    instantiate class: android.support.v7.widget.SearchView
        java.lang.reflect.InvocationTargetException
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.MenuInflater$MenuState.newInstance(MenuInflater.java:471)
                at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:430)
                at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:451)
                at android.view.MenuInflater.parseMenu(MenuInflater.java:188)
                at android.view.MenuInflater.inflate(MenuInflater.java:110)
                at de.treevo.app.search.onCreateOptionsMenu(search.java:260)
                at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
                at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:489)
                at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:853)
                at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:273)
                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
                at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                at android.view.Choreographer.doFrame(Choreographer.java:543)
                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5017)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
         Caused by: android.view.InflateException: Binary XML file line #41: Error inflating class 
                at android.view.LayoutInflater.createView(LayoutInflater.java:620)
                at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
                at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                at android.support.v7.widget.SearchView.(SearchView.java:262)
                at android.support.v7.widget.SearchView.(SearchView.java:254)
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.MenuInflater$MenuState.newInstance(MenuInflater.java:471)
                at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:430)
                at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:451)
                at android.view.MenuInflater.parseMenu(MenuInflater.java:188)
                at android.view.MenuInflater.inflate(MenuInflater.java:110)
                at de.treevo.app.search.onCreateOptionsMenu(search.java:260)
                at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
                at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:489)
                at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:853)
                at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:273)
                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
                at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                at android.view.Choreographer.doFrame(Choreographer.java:543)
                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5017)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
         Caused by: java.lang.reflect.InvocationTargetException
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.LayoutInflater.createView(LayoutInflater.java:594)
                at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
                at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                at android.support.v7.widget.SearchView.(SearchView.java:262)
                at android.support.v7.widget.SearchView.(SearchView.java:254)
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.MenuInflater$MenuState.newInstance(MenuInflater.java:471)
                at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:430)
                at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:451)
                at android.view.MenuInflater.parseMenu(MenuInflater.java:188)
                at android.view.MenuInflater.inflate(MenuInflater.java:110)
                at de.treevo.app.search.onCreateOptionsMenu(search.java:260)
                at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
                at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:489)
                at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:853)
                at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:273)
                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
                at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                at android.view.Choreographer.doFrame(Choreographer.java:543)
                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5017)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
         Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path):
    TypedValue{t=0x2/d=0x7f010030 a=-1}
                at android.content.res.Resources.loadDrawable(Resources.java:2068)
                at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
                at android.widget.ImageView.(ImageView.java:129)
                at android.widget.ImageView.(ImageView.java:119)
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.LayoutInflater.createView(LayoutInflater.java:594)
                at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
                at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                at android.support.v7.widget.SearchView.(SearchView.java:262)
                at android.support.v7.widget.SearchView.(SearchView.java:254)
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at android.view.MenuInflater$MenuState.newInstance(MenuInflater.java:471)
                at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:430)
                at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:451)
                at android.view.MenuInflater.parseMenu(MenuInflater.java:188)
                at android.view.MenuInflater.inflate(MenuInflater.java:110)
                at de.treevo.app.search.onCreateOptionsMenu(search.java:260)
                at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
                at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:489)
                at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:853)
                at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:273)
                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
                at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                at android.view.Choreographer.doFrame(Choreographer.java:543)
                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5017)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)</p>
  </blockquote>
  
  <p>and when i push the search icon nothing happen :(</p>
  
  <p>Edit1:</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.offline, menu);
      MenuItem searchItem = menu.findItem(R.id.action_search);
      mSearchView = (SearchView) searchItem.getActionView();
      //setupSearchView(searchItem);
  
     // menu.findItem(R.id.action_search).getActionView();
  
      return true;
  }
  </code></pre>