Example usage for android.app Notification BADGE_ICON_SMALL

List of usage examples for android.app Notification BADGE_ICON_SMALL

Introduction

In this page you can find the example usage for android.app Notification BADGE_ICON_SMALL.

Prototype

int BADGE_ICON_SMALL

To view the source code for android.app Notification BADGE_ICON_SMALL.

Click Source Link

Document

If this notification is being shown as a badge, use the #getSmallIcon() to represent this notification.

Usage

From source file:com.commonsware.android.notify.channel.MainActivity.java

public void raiseBattle(View view) {
    Notification n = new NotificationCompat.Builder(MainActivity.this, CHANNEL_BATTLE)
            .setContentTitle(getString(R.string.notif_battle_title))
            .setContentText(getString(R.string.notif_battle_text))
            .setSmallIcon(android.R.drawable.stat_sys_warning).setBadgeIconType(Notification.BADGE_ICON_SMALL)
            .setColor(Color.RED).setColorized(true).build();

    mgr.notify(NOTIF_ID_BATTLE, n);//from w  ww .  jav  a  2  s  . c o  m
}