Reputation: 4419
I've a MainActivity linked with navigation component. Every fragment has its own implementation of Toolbar and I setup it, calling this method defined in the activity, from the specific fragment:
fun setupToolbar(toolbar: Toolbar) {
setSupportActionBar(toolbar)
supportActionBar?.setDisplayShowTitleEnabled(false)
NavigationUI.setupActionBarWithNavController(this, navController)
setupActionBarWithNavController(navController)
}
Now, this is working great, except that now I need to add a context menu (beside the classic options menu) to delete an item of a list. When I long-press a view, this is the result:
How can I avoid this duplicate? Why the context menu is not honoring the toolbar I setup earlier?
Upvotes: 1
Views: 29