android - Calling a Fragment method from a parent Activity -


i see in android fragments dev guide "activity can call methods in fragment acquiring reference fragment fragmentmanager, using findfragmentbyid() or findfragmentbytag()."

the example follows shows how fragment reference, not how call specific methods in fragment.

can give example of how this? call specific method in fragment parent activity. thanks.

not question simple :

examplefragment fragment = (examplefragment) getfragmentmanager().findfragmentbyid(r.id.example_fragment); fragment.<specific_function_name>();  

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -