I am very new to Android. Please give me a solution. I am in confusion. I have below line of code in
activity_main.xml file:
<ImageView
android:id="@+id/exit_img"
android:src = "@drawable/exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_alignParentEnd="true"
android:onClick="exitsys()"
android:resizeMode="horizontal|vertical" />
and in MainActivity.java file below lines of code:
public void exitsys(View v){
System.exit(0);
}
But Android Studio is giving error that "Method exitsys() is missing in 'MainActivity' or has incorrect signature"
I don't know what mistake I did. Also as information, I am new to Java as well.