anthony
anthony

Reputation: 7733

Android: icon notification blinking

How to have this blink effect on my notification icon during a download file, like that:

enter image description here

MY ANSWER

Just use this native drawable android.R.drawable.stat_sys_download

mBuilder.setContentTitle(title)
        .setContentText(filename)
        .setSmallIcon(android.R.drawable.stat_sys_download);

Upvotes: 0

Views: 1092

Answers (1)

RobVoisey
RobVoisey

Reputation: 1083

Try using an animation drawable.

For example:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
   <item android:drawable="@drawable/frame1On" android:duration="1000" />
   <item android:drawable="@drawable/frame2Off" android:duration="1000" />
</animation-list>

Where frame1On on is the image highlighted, and frame2Off is the image greyed out. Add more frames if necessary.

Upvotes: 1

Related Questions