Android Question notification icon ok on emulator but not on device

drgottjr

Expert
Licensed User
Longtime User
no problem on the emulator (4.22, api17, target 21, halo) , but i get a little blank square when app is deployed to nexus4 or moto with 5.1. what did i screw up: theme? sdk? target? what do i need? (icon is in apk in res/drawable) thanks.
 

drgottjr

Expert
Licensed User
Longtime User
no problem on the emulator (4.22, api17, target 21, halo) , but i get a little blank square when app is deployed to nexus4 or moto with 5.1. what did i screw up: theme? sdk? target? what do i need? (icon is in apk in res/drawable) thanks.
in reply to my own question, i see (via some android development forums) that setting the target to < 21 works (it does), but that solution appears not to be the proper solution. google apparently made some changes regarding the notification icon for target > 20. has that been addressed here? members' problems with the notification icon involved other matters, from what i saw in searching the forum earlier. thanks.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
If the targetSdkVersion is 21+ and the device runs Android 5+ then the non-transparent colors will be white.

For example (The A icon is the new B4A-bridge icon):


The solution is to create similar icons.


thanks. so i get it. sort of. although i have to say that thinking in terms of reverse transparent silhouettes does not come easily.
what i'm looking for is for my notification to appear normally regardless of the device. is that even possible? for a moment i thought that setting the target < 21 would allow my icon to look normal on devices up through 5. that appeared to be the case; i go from 4.4.2 through 5.1, and the notification looked fine. but then i loaded the app on a device running 6 and the icon goes back to a blank white square. but - and this is rich - when i drag the blank notification down to see what it says, suddenly there is the icon perfectly rendered!
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
thanks. i'll give it a shot. 3 steps forward, 2 steps back
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…