How do I make a counting app?



How do I make an app that counts button clicks? I'm not sure if I even need to set an onClick action, though. I'm also not sure what to do for Java, although I did do something similar to this before. The xml I have so far is



<Button
android:id="@+id/countButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="count"
android:text="Add One" />

<Button
android:id="@+id/resetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="reset"
android:text="Reset" />

No comments:

Post a Comment