1

I am a "noob" in Android Development.

I'm developing an app to calculate some results concerning the fitness/wellness. My app have 1 activity that includes 5 fragment:

  • a fragment for side bar (contains three imageviews, one for fragment A, one for fragment B and the last one for fragment C)
  • Fragment A (Personal Data, like name, sex, birth date, etc)
  • Fragment B (Healty, like weight, height, etc)
  • Fragment C (Results)
  • Fragment D (include a button) <-- always visible

I wish that when I click on the button (fragment D), the app calculates the results to be displayed in the textviews of fragment C, depends on the values entered in the edit text of fragment A and B.

I put the onClick method in the fragment D class (which contain the button) to handle the click. But... when I click on it, how can I "retrieve" the data from the edit text of Fragment 1 and Fragment 2 to calculate the results?

Here there is an image to indicate the behavior of my app: https://i.stack.imgur.com/QEq66.jpg

(I cannot upload directly an image on StackOverflow)

Github project: https://github.com/eldivino87/IoNutrizionista

eldivino87
  • 1,425
  • 1
  • 17
  • 30
  • So the question is how to evaluate the results from data that are stored on two other, not active fragments. I'm curious to what people will say. – EpicPandaForce Mar 18 '15 at 16:27
  • Go through this link http://stackoverflow.com/questions/13700798/basic-communication-between-two-fragments – Hulk Mar 18 '15 at 16:30
  • I put the onClick method in the fragment D class (which contain the button) to handle the click. **But... when I click on it, how can I "retrieve" the data from the edit text of Fragment 1 and Fragment 2 to calculate the results?** – eldivino87 Mar 18 '15 at 17:55

0 Answers0