title: how to use ripple effect for a button
body: <p>I'm using the eclipse. I want to use <em><code>ripple effect</code></em> .</p>
  
  <p>I have appcompat-v7:21.0.0.</p>
  
  <p>drawable/test.xml</p>
  
  <pre><code>&lt;ripple xmlns:android="http://schemas.android.com/apk/res/android"
      android:color="@android:color/white"&gt; &lt;!-- ripple color --&gt;
  
      &lt;item android:drawable="@android:color/holo_blue_bright"/&gt; &lt;!-- normal color --&gt;
  
  &lt;/ripple&gt;
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.ex48_materialdesign.MainActivity" 
      android:orientation="vertical"&gt;
  
  
      &lt;Button 
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="test"
          android:background="@drawable/test"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>But I get these errors :</p>
  
  <pre><code>&gt; 03-12 15:12:11.441: E/AndroidRuntime(4828): FATAL EXCEPTION: main
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):
  &gt; java.lang.RuntimeException: Unable to start activity
  &gt; ComponentInfo{com.example.ex48_materialdesign/com.example.ex48_materialdesign.MainActivity}:
  &gt; android.view.InflateException: Binary XML file line #13: Error
  &gt; inflating class android.widget.Button 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2247)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.app.ActivityThread.access$700(ActivityThread.java:152) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.os.Handler.dispatchMessage(Handler.java:99) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.os.Looper.loop(Looper.java:137) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.app.ActivityThread.main(ActivityThread.java:5328) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; java.lang.reflect.Method.invokeNative(Native Method) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; java.lang.reflect.Method.invoke(Method.java:511) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; dalvik.system.NativeStart.main(Native Method) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828): Caused by: android.view.InflateException:
  &gt; Binary XML file line #13: Error inflating class android.widget.Button
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.view.LayoutInflater.createView(LayoutInflater.java:619) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.view.LayoutInflater.rInflate(LayoutInflater.java:752) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.view.LayoutInflater.inflate(LayoutInflater.java:495) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.view.LayoutInflater.inflate(LayoutInflater.java:397) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.view.LayoutInflater.inflate(LayoutInflater.java:353) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; com.example.ex48_materialdesign.MainActivity.onCreate(MainActivity.java:13)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.app.Activity.performCreate(Activity.java:5250) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   ... 11 more 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828): Caused by:
  &gt; java.lang.reflect.InvocationTargetException 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; java.lang.reflect.Constructor.constructNative(Native Method) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; java.lang.reflect.Constructor.newInstance(Constructor.java:417) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.view.LayoutInflater.createView(LayoutInflater.java:593) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     ... 24 more 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828): Caused by:
  &gt; android.content.res.Resources$NotFoundException: File
  &gt; res/drawable/test.xml from drawable resource ID #0x7f020034 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.content.res.Resources.loadDrawable(Resources.java:2842) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.content.res.TypedArray.getDrawable(TypedArray.java:602) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     at
  &gt; android.view.View.&lt;init&gt;(View.java:3460) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.widget.TextView.&lt;init&gt;(TextView.java:791) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.widget.Button.&lt;init&gt;(Button.java:107) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.widget.Button.&lt;init&gt;(Button.java:103) 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   ... 27 more 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828): Caused by:
  &gt; org.xmlpull.v1.XmlPullParserException: Binary XML file line #1:
  &gt; invalid drawable tag ripple 03-12 15:12:11.441:
  &gt; E/AndroidRuntime(4828):   at
  &gt; android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:917)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.graphics.drawable.Drawable.createFromXml(Drawable.java:858)
  &gt; 03-12 15:12:11.441: E/AndroidRuntime(4828):   at
  &gt; android.content.res.Resources.loadDrawable(Resources.java:2839) 03-12
  &gt; 15:12:11.441: E/AndroidRuntime(4828):     ... 32 more
  </code></pre>