Reputation: 15
I am making an android app and I want it so that when someone clicks a button in the main menu activity, they are taken to the corresponding activity. At the moment my code is:
button in menu xml:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dwight Quotes"
android:id="@+id/DwightButton"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:onClick="openNewActivity"
android:background="#EAD383"
android:enabled="false" />
the menu java:
public void openNewActivity(View view) {
// Do something in response to button
Intent intent = new Intent(this, Dwight.class);
startActivity(intent);
when I click the button nothing happens. Can someone explain what I need to do?
Upvotes: 0
Views: 57