Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to replace the three dots in the TOOLBAR menu (not the action bar)

How to replace the three dots that appear in the Toolbar by an image.

Is that even possible?

like image 812
Alfonso Fernandez-Ocampo Avatar asked Dec 11 '22 10:12

Alfonso Fernandez-Ocampo


1 Answers

The "three dots" you see is called the "overflow icon", which is a configurable part of android.support.v7.widget.Toolbar.

In Java, call:

Drawable d = /* your drawable here */;
toolbar.setOverflowIcon(d);

Documentation here: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html#setOverflowIcon(android.graphics.drawable.Drawable)

like image 57
Ben P. Avatar answered Jan 11 '23 23:01

Ben P.