0

When you override the onCreateOptionsMenu() you get a options menu which opens when you click the 3 dot icon on top right. I want to show a circular image view with image of a user instead of the 3 dot icon. How do I do this?

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
    menuInflater.inflate(R.menu.options_menu, menu);
    return true
}
Amol Borkar
  • 2,321
  • 7
  • 32
  • 63
  • Does this answer your question? [How to change three dots button on android to other button](https://stackoverflow.com/questions/30267758/how-to-change-three-dots-button-on-android-to-other-button) – Chetan Gupta Feb 16 '20 at 17:53
  • This link can be helpful: https://stackoverflow.com/questions/27692351/adding-icon-on-action-bar-instead-of-three-dots – Camellia Feb 17 '20 at 13:11

1 Answers1

1

Hi @Amol you can learn more about the toolbar from codepath guide,

try to replace toolbar

<androidx.appcompat.widget.Toolbar
       android:layout_width="match_parent"
       android:layout_height="wrap_content">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <androidx.appcompat.widget.AppCompatImageView
                android:layout_marginTop="16dp"
                android:layout_marginEnd="16dp"
                android:layout_gravity="end"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@mipmap/ic_launcher_round" />

        </FrameLayout>


</androidx.appcompat.widget.Toolbar>

if you just want to replace the icon and still keep overflow menu read from the similar answer from this

Chetan Gupta
  • 1,477
  • 1
  • 13
  • 22