Actions in Android Studio

Bruno Retolaza · September 3, 2021

One cool feature, I’ve recently found, is the possibility to add custom action buttons to almost anywhere in the Android Studio toolbars.

In my case, and I know most Android Developers could relate, I am hitting the infamous Invalidate Caches & Restart a couple of times a day. So as a way to make it happen faster (saving one mouse click, yeah!) I added a button to my Navigation Bar Toolbar.

To see what can be edited / added, you need to go to Preferences → Appearance & Behavior → Menus and Toolbars.

https://github.com/Kuruchy/kuruchy.github.io/raw/master/images/Android_Studio_Actions_01.png

We can add actions to a lot of places, making our life easier.

To create a button and add an action, we click on the + icon, and we will get the possibility to Add Action or Add Separation.

If we choose the Add Action, we would get the following popup to choose the action we want.

https://github.com/Kuruchy/kuruchy.github.io/raw/master/images/Android_Studio_Actions_02.png

You could also select a custom Icon for that action. I’ve chosen a “Fingers Crossed”.

https://github.com/Kuruchy/kuruchy.github.io/raw/master/images/Android_Studio_Actions_03.png

And that’s it! You now have an Action that Invalidate Caches & Restart

https://github.com/Kuruchy/kuruchy.github.io/raw/master/images/Android_Studio_Actions_04.png

Twitter