title: java.lang.UnsupportedOperationException in Canvas
body: <p>I used a custom <code>ImageView</code> in my app. But it shows  </p>
  
  <blockquote>
    <p>java.lang.UnsupportedOperationException</p>
  </blockquote>
  
  <p>in the code <code>canvas.clipPath(clipPath)</code>. </p>
  
  <p>I don't know why I got this error. It works perfectly on some phones.</p>
  
  <pre><code>public class Gma_CustomImage2 extends ImageView {
  
      public static float radius = 10.0f;  
  
      public Gma_CustomImage2(Context context) {
          super(context);
      }
  
      public Gma_CustomImage2(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public Gma_CustomImage2(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          Path clipPath = new Path();
          RectF rect = new RectF(0, 0, this.getWidth(), this.getHeight()+13.0f);
          clipPath.addRoundRect(rect, radius, radius, Path.Direction.CW);
          canvas.clipPath(clipPath);
          super.onDraw(canvas);
      }
  }
  </code></pre>
  
  <p><strong>LogCat</strong></p>
  
  <pre><code>08-08 12:04:47.963: E/AndroidRuntime(5710): FATAL EXCEPTION: main
  08-08 12:04:47.963: E/AndroidRuntime(5710): java.lang.UnsupportedOperationException
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at    android.view.GLES20Canvas.clipPath(GLES20Canvas.java:408)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at com.example.meetap.Gma_CustomImage2.onDraw(Gma_CustomImage2.java:34)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.draw(View.java:10982)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10421)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.draw(View.java:10985)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.widget.FrameLayout.draw(FrameLayout.java:450)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.widget.ScrollView.draw(ScrollView.java:1524)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getHardwareLayer(View.java:10220)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.drawChild(ViewGroup.java:2863)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at com.example.meetap.Gma_CustomViewBehind.dispatchDraw(Gma_CustomViewBehind.java:121)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10419)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10419)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.View.getDisplayList(View.java:10384)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:842)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewRootImpl.draw(ViewRootImpl.java:1935)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1659)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.os.Handler.dispatchMessage(Handler.java:99)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.os.Looper.loop(Looper.java:137)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at java.lang.reflect.Method.invoke(Method.java:511)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  08-08 12:04:47.963: E/AndroidRuntime(5710):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>