Issue
I got a method()
in the fragment. Fragment in host activity. So I need to call the method()
from fragment ONLY when host activity was in onDestroy()
. Maybe it suppose to be something like a static flag?
Solution
You can, by SupportFragmentManager, get a Fragment by layout id, tag or name. But the most important thing here is in some situations Activity.onDestroy() method could never be called. So be careful if you implement code that needs to be executed, like an unsubscribe logic or removing callbacks.
Answered By - FacuArg
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.