tyb tyb - 1 year ago 109
Android Question

Passing data between a fragment and its container activity

How can i pass data between a fragment and its container activity? Is there something similar to passing data between activities through intents?

I read this: http://developer.android.com/guide/topics/fundamentals/fragments.html#CommunicatingWithActivity

But it didn't help much.
Any help is appreciated

Answer Source

In your fragment you can call getActivity(). This will give you access to the activity that created the fragment. From there you can obviously call any sort of accessor methods that are in the activity.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download