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. 大量的;实质的;内容充实的