I finally got my image button to work within an ImageView, and after I press it, it works, but imnmediately after, it stops running and I get the error message to close it.
I added the onClick and focused it in the XML so that it will work within an imageview, but that’s all I got. The button in the /drawable folder is the imagebutton selector code:
http://developer.android.com/reference/android/widget/ImageButton.html
<ImageView
android:onClick="true"
android:src="@drawable/button"
android:focusable="true"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:scaleType="fitStart"
I have a suspicion that I’m forgetting something….
Yes the first user is right. The mistake is with the
android:onClickevent. It is not a Boolean value. It is used to specify the name of your method that should be fired when a user clicks on the button. Check this sample here scroll down to the bottom and check how they have implemented this property.http://android-developers.blogspot.com/2009/10/ui-framework-changes-in-android-16.html