1

Im a beginner in Android and I have the following Problem:

I've created a TabHost within two tabs: activity A and activity B.

Activity A consists of a linear Layout with dynamically added checkboxes:

Activity A:

1[ ] 
2[ ] 
3[x] 
4[ ] 
5[x]

Activity B consists of an empty linear Layout.

Now I want the checked checkboxes from activity A to be added in activity B:

Activity B:

3[x]
5[x]

These checkboxes should disappear if they were unchecked...

Activity B:

...is empty again.

What technique should be used to do something like that?

schirrmacher
  • 2,341
  • 2
  • 27
  • 29

1 Answers1

1

The easiest way to pass information from one ACtivity to another is usually by passing a bundle (sounds like it fits your case). You can pass the strings or numbers of the selected boxes from A to be (here is an explanation of passing bundles) then in be add those check boxes according to the bundle.

Community
  • 1
  • 1
MikeIsrael
  • 2,871
  • 2
  • 22
  • 34
  • Thanks! I think this could be the solution for my Problem. Can you give me a short example in code? Now I know how to get Strings or Ints but how can I get the checkbox View from this data? – schirrmacher Sep 06 '12 at 15:28
  • It is not very practical to pass a whole view. I don't know your demands but I would say pass the views titles to the next activity and then rebuild the check boxes based on number of titles – MikeIsrael Sep 07 '12 at 11:02