I'm new to android/java and I'm not sure how to solve the following problem:
Basically, I am creating a fitness tracker app and I need to be able to add details about an exercise (a text view and a couple text input fields) to my 'activity_weights_main' when the relevant exercise button is clicked in my 'activity_exercises'page.
At the minute I am trying to call the exercise buttons from 'activity_exercises' in my 'WeightsMain' java class via the code below:
btnCableCrunches = (Button) findViewById(R.id.btnCableCrunches);
After I'm able to call the 'btnCableCrunches' in my 'WeightsMain' java class, I'm planning on creating a method which will add the textviews/input fields that I need. I'm aware this is probably a stupid question but I've been trying to research how to do this for quite a while now with no success.
So I guess my question is: How do I call this button from another activity (activity_exercises) so that I can create a method (in 'WeightsMain.java') to add textviews/input fields (in 'activity_weights_main').
I don't need to know how to create the onClick method, just need to know how to call the button from other activity so I can do so myself. Thanks in advance for any feedback!