title: InflateException (Error inflating class) when using custom widget in xml
body: <p>I created a custom imageview. But I get an InflateException when I try to run this. Can someone help me solve this?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/herinnering_background"&gt;
   &lt;be.test.ArrowImageView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/kompas_arrow_car"
    /&gt;
  &lt;/FrameLayout&gt;
  
  
  package be.test;
  
  import android.content.Context;
  import android.graphics.Canvas;
  import android.graphics.Color;
  import android.graphics.Paint;
  import android.widget.ImageView;
  
  public class ArrowImageView extends ImageView{
  
      public ArrowImageView(Context context) {
          super(context);
      }
  
      @Override
      public void draw(Canvas canvas) {
          super.draw(canvas);
  
          Paint paint  = new Paint(Paint.LINEAR_TEXT_FLAG);
          paint.setColor(Color.GREEN);
          paint.setTextSize(12.0F);
          canvas.drawText("Hello World in custom view", 100, 100, paint);
      }
  }
  </code></pre>