当我调试我的应用程序时,一切正常,但是当我构建 APK(调试、发布、签名..)时,它在我按下按钮后崩溃。
我的 onClick 方法:
protected void Click(View V) {
Toast.makeText(this, "Hi!", Toast.LENGTH_SHORT).show();
}
按钮 XML:
<Button
android:id="@+id/btnSpy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:onClick="Click"
android:text="Activate"
android:textAllCaps="false"
tools:layout_editor_absoluteX="148dp"
tools:layout_editor_absoluteY="212dp" />
编辑:抱歉忘记将 Spy 更改为 Click