I have a class named CropImageView which is extended from ImageView. but the statement below makes castException:
CropImageView image = (CropImageView) findViewById(R.id.image);
here is the xml file:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView android:id="@+id/image"
android:background="#55000000"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_x="0dip"
android:layout_y="0dip"/>
</RelativeLayout>
</FrameLayout>
do you have any suggestion?
You should use the
CropImageViewcanonical name in theXML. Something like: