Beispiel #1
0
  @Override
  protected Notification fillNotification(NotificationCompat.Builder notificationBuilder) {
    NotificationCompat.WearableExtender morePageNotification =
        new NotificationCompat.WearableExtender();

    String firstContent = "", firstTime = "";
    for (TransportManager.Departure d : mDepartures) {
      if (firstTime.isEmpty()) {
        firstTime = d.countDown + "min";
        firstContent = d.servingLine;
      }

      NotificationCompat.Builder pageNotification =
          new NotificationCompat.Builder(mContext)
              .setContentTitle(d.countDown + "min")
              .setContentText(d.servingLine);
      morePageNotification.addPage(pageNotification.build());
    }

    notificationBuilder.setContentTitle(firstTime);
    notificationBuilder.setContentText(firstContent);
    Bitmap bm = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.wear_mvv);
    morePageNotification.setBackground(bm);
    return morePageNotification.extend(notificationBuilder).build();
  }