1

I have an ActionBarActivity that has a ViewPager with two Fragments and tabs created with ActionBar from the support library. My ActionBarActivity has also two buttons: cancel and save. When the save button is pressed, I need to get data from both of my Fragments. How do I do this? This data is stored fetched from the layout and stored in local variables in the Fragments.

2
  • you should be able get access to your fragments by use of FragmentManager by id or tag. getFragmentManager().findFragmentById() Commented Dec 8, 2013 at 15:31
  • @AlexeyA. Hey, thanks for this. You should post this as an answer! Commented Dec 8, 2013 at 15:36

1 Answer 1

1

You should be able get access to your fragments by use of FragmentManager by id or tag. getFragmentManager().findFragmentById() or getFragmentManager().findFragmentByTag()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.