android DialogFragment android:onClick=“buttonCancel” causes IllegalStateException could not find a method
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with my Dialog Fragment. I wanted to use android:onClick attribute as in my opinion code is more clear then. In my layout I have the following declaration: <Button android:id="@+id/dialog_new_database_button_cancel" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/button_cancel" android:maxLines="1" style="?android:attr/buttonBarButtonStyle" android:onClick="buttonCancel" /> Now my DialogFragment import android.os.Bundle; import android.support.v4.app