1

Can someone tell me why onAttach() is not getting called on Fragment that have been replaced within Activity ? onDetach() is working perfectly fine.

The reason why I am asking about that is because I'm trying to change Toolbar title when different Fragments are being replaced in Activity.

EDIT My question is different because my onAttach() is getting called when Fragment is getting replaced, its not called however when rotation occurs.

JakubW
  • 1,101
  • 1
  • 20
  • 37
  • are you adding the fragment back again when the activity recreates? – ata May 13 '15 at 09:06
  • possible duplicate of [Replacing fragments in an activity not calling onAttach, onCreate, onCreateView, etc](http://stackoverflow.com/questions/24956034/replacing-fragments-in-an-activity-not-calling-onattach-oncreate-oncreateview) – Tim May 13 '15 at 09:06
  • @Ata yes I do add it back when activity recreates, otherwise the question would not have had a point :) – JakubW May 13 '15 at 09:12

0 Answers0