I’ve got the following button in my xml layout file…
<Button
android:layout_width="150dip"
android:id="@+id/button1"
android:layout_height="50dip"
android:text="@string/login"
android:layout_marginRight="10dip">
</Button>
I’d like to programmatically add an onclick() listener in it’s Java file. How would I do this?
You just need something like this: