Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 22.214.171.124 release ready!
Owner and Founder. Opencart
The fragment is one of the coolest android component. What makes it this cool is its lifecycle which is tightly coupled with the Activity containing it.
There are times when we are adding, replacing or removing fragment in/out from the activity. We need to reflect the changes in the activity also such as changing the activity’s/action bar title which is associated with each Fragment.
There is an Activity called MainActivity which contain three fragment like.
Now, MainActivity has
Let say, on changing any fragment we what to change the activity’s / action bar title.
This can be done by implementing FragmentManager.OnBackStackChangedListener in the activity containing those fragments.
On overriding the onBackStackChanged method, we can easily change the title and other things as per our need.
That’s all from side.
Happy coding !!
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.