Custom views in the action bar

I have an action bar. One of the elements of the action bar is for notifications. I want to add a small icon in the upper right corner of the action bar item that displays the number of notifications that the user currently has.

I went ahead and created a custom layout for the action bar item. Went to add it, and, to my surprise, I have no way to add a custom view as a button on the action bar.

I use Actionbar-Sherlock for compatibility with an older device.

This is what I am going to do:

enter image description here

+4
source share
1 answer

Source: https://habr.com/ru/post/1435783/


All Articles