Android - show animated status bar icon

穿精又带淫゛_ 提交于 2019-12-01 04:52:58

The solution is simple, but very tricky. You just need to add

notificationBuilder.setTicker(getString(R.string.notification_ticker));

the magic happens and your icon is animated. It is related to this bug:

http://code.google.com/p/android/issues/detail?id=15657

Hope it helps someone.

Just to add to @gingo's answer, in case you don't want any text to be shown in the status bar then keep your notification_ticker String as blank in strings.xml (which is quite obvious).

Also, if you want the animated icon to stop after the progress or download/ upload has completed then set a similar looking icon to your notificationBuilder and call the notify method on the notification manager as,

 mBuilder.setSmallIcon(R.drawable.ic_download);
 mNotifyManager.notify(0, mBuilder.build());
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!