Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have figured out how this is done for Sony devices.</p> <p>I've blogged about it <a href="http://marcusforsberg.net/blog/android-how-to-add-a-notification-badge-to-app-icon-on-sony-xperia-devices/" rel="nofollow noreferrer">here</a>. I've also posted a seperate SO question about this <a href="https://stackoverflow.com/questions/20216806/how-to-add-a-notification-badge-count-to-application-icon-on-sony-xperia-devices">here</a>.</p> <hr> <p>Sony devices use a class named <code>BadgeReciever</code>.</p> <ol> <li><p>Declare the <code>com.sonyericsson.home.permission.BROADCAST_BADGE</code> permission in your manifest file: </p></li> <li><p>Broadcast an <code>Intent</code> to the <code>BadgeReceiver</code>:</p> <pre><code>Intent intent = new Intent(); intent.setAction("com.sonyericsson.home.action.UPDATE_BADGE"); intent.putExtra("com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME", "com.yourdomain.yourapp.MainActivity"); intent.putExtra("com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE", true); intent.putExtra("com.sonyericsson.home.intent.extra.badge.MESSAGE", "99"); intent.putExtra("com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME", "com.yourdomain.yourapp"); sendBroadcast(intent); </code></pre></li> <li><p>Done. Once this <code>Intent</code> is broadcast the launcher should show a badge on your application icon.</p></li> <li><p>To remove the badge again, simply send a new broadcast, this time with <code>SHOW_MESSAGE</code> set to false:</p> <pre><code>intent.putExtra("com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE", false); </code></pre></li> </ol> <p>I've excluded details on how I found this to keep the answer short, but it's all available in the blog. Might be an interesting read for someone.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload