Closed SachinBahukhandi closed 6 years ago
Is the broadcast receiver happening on the main thread?
I have registered the reciever inside the OnCreate
.
ensure the onReceive happens on the main thread. Also compare your code with the sample app in which it works.
Perhaps it also breaks with the new androidX or material library
How to ensure that?
This is the project's design and appcompat ver:
implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.0'
please use google. that's one of the standard things on android :)
ok these dependencies should be fine. just compare how it works in the sample app
https://stackoverflow.com/a/20248093/5192105 according to this it works on the main thread.
I suppose your sample app does not have use of the method:
ActionItemBadge.update(item,1);
Where is the sample app???
Yes I had seen it already. The issue is in menu_item.xml
file.
Because the icon is not displaying even if I don't set the count in the java
file.
So it is not a problem of the library, but the main menu you defined? Make sure you supply a proper available icon
Here is my
menu_item.xml
Inside
MainActivity.java
I am calling this inside this segment:
Here is the screenshot: