title: AppCompatImageView cannot be cast to my class
body: <p>I have problem with my android java code, I hope you can help me with this.</p>
  
  <p>I have my class with ImageView parent... some like this:</p>
  
  <pre><code>public abstract class BaseStatus extends ImageView
  {
      public BaseStatus(Context context){
          super(context);
      }
  }
  
  public class BluetoothStatus extends BaseStatus
  {
      public BluetoothStatus(Context context){
          super(context);
      }
  }
  </code></pre>
  
  <p>and I want to get the component as ImageView from the XML, you know...</p>
  
  <pre><code>BluetoothStatus btStatus;
  btStatus = (BluetoothStatus) findViewById(R.id.bt_status); // ERROR
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;ImageView
          android:layout_width="85dp"
          android:layout_height="wrap_content"
          android:id="@+id/bt_status"
          android:src="@drawable/bluetooth"
          android:layout_alignTop="@+id/button3"
          android:layout_alignEnd="@+id/lb_laser" /&gt;
  </code></pre>
  
  <p>and i got this message:</p>
  
  <p>Caused by: java.lang.ClassCastException: android.support.v7.widget.AppCompatImageView cannot be cast to net.antiradary.radarhunter.activity.status.BluetoothStatus</p>
  
  <p>Why i can not cast ImageView into BluetoothStatus? 
  Thank you for you answers!</p>