https://developer.android.com/training/building-wearables.html

standalone adj. 单独的

With the introduction of standalone Wear apps, both the watch and the phone can be sources of notifications. Use the NotificationCompat.Builder class to create notifications for wearables. When you build notifications with this class, the system takes care of displaying notifications properly, whether they appear on a watch or phone.

随着独立应用程序的引入,手表和手机都可以成为通知的来源。使用NotificationCompat.Builder类创建可穿戴设备的通知。当您使用这个类构建通知时,系统将正确地显示通知,无论它们是出现在手表或电话上。

Notifications using RemoteViews are stripped of custom layouts and the wearable only displays the text and icons. However, you can create custom notifications that use custom card layouts by creating a wearable app that runs on the watch

stripped adj. 剥去的
通知在手表上只显示text和icon,但是你可以设计针对手表的布局。

int notificationId = 001;
// The channel ID of the notification.
String id = "my_channel_01";
// Build intent for notification content
Intent viewIntent = new Intent(this, ViewEventActivity.class);
viewIntent.putExtra(EXTRA_EVENT_ID, eventId);
PendingIntent viewPendingIntent =
        PendingIntent.getActivity(this, 0, viewIntent, 0);

// Notification channel ID is ignored for Android 7.1.1
// (API level 25) and lower.
NotificationCompat.Builder notificationBuilder =
    new NotificationCompat.Builder(this, id)
        .setSmallIcon(R.drawable.ic_event)
        .setContentTitle(eventTitle)
        .setContentText(eventLocation)
        .setContentIntent(viewPendingIntent);


// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
        NotificationManagerCompat.from(this);

// Issue the notification with notification manager.
notificationManager.notify(notificationId, notificationBuilder.build());

substantial adj. 大量的;实质的;内容充实的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值