Package com.microej.wear.components

## Interface Activity

-     public interface Activity

  Represents an activity.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Renderable` | `createRenderable()` | Creates a renderable that renders this activity.
    `String` | `getName()` | Gets the name of this activity.
    `void` | `onIconAttached()` | Called when the icon is scheduled for imminent rendering.
    `void` | `onIconDetached()` | Called when the icon is no longer scheduled for imminent rendering.
    `void` | `renderIcon​(GraphicsContext g, int x, int y, int size)` | Renders the icon of this activity.

- - ### Method Detail

    - #### getName

          String getName()

      Gets the name of this activity.
      Returns:
        the name of this activity.

    - #### onIconAttached

          void onIconAttached()

      Called when the icon is scheduled for imminent rendering.

      For example, this method can load the resources necessary for rendering.

    - #### onIconDetached

          void onIconDetached()

      Called when the icon is no longer scheduled for imminent rendering.

      For example, this method can dispose of the resources loaded in `onIconAttached()`.

    - #### renderIcon

          void renderIcon​(GraphicsContext g,
                          int x,
                          int y,
                          int size)

      Renders the icon of this activity.
      Parameters:
        `g` - the graphics context to draw with.
        `x` - the x coordinate of the region to draw in.
        `y` - the y coordinate of the region to draw in.
        `size` - the width and height of the region to draw in.

    - #### createRenderable

          Renderable createRenderable()

      Creates a renderable that renders this activity.

      This method is called when the activity is scheduled for imminent rendering. The renderable is then attached immediately by calling (see `Renderable.onAttached()`).

      Returns:
        the renderable.