How to add dividers between specific menu items?

You should use action layout <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” tools:context=”.LandingActivity”> <item android:id=”@+id/action_cart” android:title=”cart” android:actionLayout=”@layout/cart_update_count” android:icon=”@drawable/shape_notification” app:showAsAction=”always”/> </menu> and then the action layout can have the textview with divider. <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”wrap_content” android:layout_height=”match_parent” android:orientation=”vertical”> <View android:id=”@+id/divider” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/divider”/> <TextView android:id=”@android:id/text” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”?android:attr/selectableItemBackground” android:gravity=”center_vertical” android:textAppearance=”?attr/textAppearanceListItemSmall”/> </LinearLayout> then you can add the click listener in code

Bootstrap dropdown sub menu missing

Bootstrap 5 (update 2021) Add some JavaScript to prevent the submenu from closing when the parent dropdown is open. This can be done be toggle display:block… let dropdowns = document.querySelectorAll(‘.dropdown-toggle’) dropdowns.forEach((dd)=>{ dd.addEventListener(‘click’, function (e) { var el = this.nextElementSibling el.style.display = el.style.display===’block’?’none’:’block’ }) }) Bootstrap 5 Multi-level Dropdown – click Bootstrap 5 Multi-level Dropdown – … Read more