I would like to add the left and right buttons to my actual card rather than being below the card. I have added them to the card in the card layout but now I can't figure out how to access the buttons in my activity. How can I go about this?
Now in the activity I tried the following (apply is the name of my button):
@OnClick(R.id.apply)
public void right() {
/**
* Trigger the right event manually.
*/
makeToast(MainActivity.this, "test");
}
Now when I try to run the project in the emulator, I get the following error message and the app crashes:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lorentzos.swipecards.example/com.lorentzos.swipecards.MainActivity}: java.lang.RuntimeException: Unable to inject views for com.lorentzos.swipecards.MainActivity@4c3946c
I think this has to do with the button not being on the main layout and it being on the actual card? How can I reference the button on the card, so that when it is pressed, it loads the next card?
I would like to add the left and right buttons to my actual card rather than being below the card. I have added them to the card in the card layout but now I can't figure out how to access the buttons in my activity. How can I go about this?
I removed the following line:
<include layout="@layout/buttons" />
From the main activity layout:
Now in the activity I tried the following (apply is the name of my button):
Now when I try to run the project in the emulator, I get the following error message and the app crashes:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lorentzos.swipecards.example/com.lorentzos.swipecards.MainActivity}: java.lang.RuntimeException: Unable to inject views for com.lorentzos.swipecards.MainActivity@4c3946c
I think this has to do with the button not being on the main layout and it being on the actual card? How can I reference the button on the card, so that when it is pressed, it loads the next card?
Thanks for the help!