In general, have the containing activity handle the communication between 
the fragments.

Let the containing Activity implement an interface that will tell it when 
important user interactions take place (e.g. item clicked in a fragment 
with a list-view).
In the fragment's onAttach, cast the Activity parameter to this interface 
and assign it to a field of the fragment.
When something important happens, call the appropriate interface method on 
this field.
The activity, implementing the method(s) of this interface, will implement 
the method(s) by calling methods on other fragment(s). 

In other words, don't couple the fragments together. Different fragments 
should not know about each other. Let the communication between them be 
handled by the containing activity.


On Sunday, March 11, 2012 3:07:23 AM UTC-4, satyaandroid wrote:
>
> Hi Android Developers.... 
>
> I tried to make communication between two fragments. 
> if i click a button one fragment the another fragment will be replaced 
> by the another new fragment.. 
>
> can you help me in this case.... 
>
> thank you........


On Sunday, March 11, 2012 3:07:23 AM UTC-4, satyaandroid wrote:
>
> Hi Android Developers.... 
>
> I tried to make communication between two fragments. 
> if i click a button one fragment the another fragment will be replaced 
> by the another new fragment.. 
>
> can you help me in this case.... 
>
> thank you........

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to