can you give a sample to show toolbar as action bar in each of controllers ?
You'd probably want to have a toolbar in the hosting activity that all controllers share, not one per controller, as that would make for some awkward looking transitions. The toolbar could then be injected into controllers using dagger (recommended) or referenced directly from the hosting activity. This would give controllers the ability to set the title, options menu, etc.
thanks
if possible add toolbar activity in your sample .
The demo app is now updated to have a toolbar. The HomeController has an options menu to demonstrate how that's done, and BaseController shows how the actionbar can be referenced from within a Controller. Again though, if this was production, I would use DI to grab the actionbar rather than casting the host activity.
What would I be injecting?? can you help me with some clarification. on what needs to be injected into either the base or the home controller?
thank you
Most helpful comment
The demo app is now updated to have a toolbar. The HomeController has an options menu to demonstrate how that's done, and BaseController shows how the actionbar can be referenced from within a Controller. Again though, if this was production, I would use DI to grab the actionbar rather than casting the host activity.