Thursday, 7 June 2018

android:onClick is not working in the layout .xml

java.lang.IllegalStateException: Could not find a method onxxxClicked(View) in the activity class android.view.ContextThemeWrapper for onClick handler on view class android.support.v7.widget.AppCompatImageButton with id 'xxxx'

if you see above error, then, your android:onClick is not working (in the layout .xml)

solution: to fix that you need to remove the android:theme from your layout.xml (from all xml elements in this layout), e.g.
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"

No comments:

Post a comment