Example usage for android.service.quicksettings Tile setIcon

List of usage examples for android.service.quicksettings Tile setIcon

Introduction

In this page you can find the example usage for android.service.quicksettings Tile setIcon.

Prototype

public void setIcon(Icon icon) 

Source Link

Document

Sets the current icon for the tile.

Usage

From source file:net.hyx.app.volumenotification.factory.NotificationFactory.java

@TargetApi(Build.VERSION_CODES.N)
public void updateTile(Tile tile, int id) {
    VolumeControl item = model.parseItem(model.getItemById(id));
    if (item != null && tile != null) {
        tile.setIcon(Icon.createWithResource(context, model.getIconDrawable(item.icon)));
        tile.setLabel(item.label);//from   w w w.java2 s .c o m
        tile.setState(Tile.STATE_ACTIVE);
        tile.updateTile();
    }
}