使您的设备保持沉默
我在我的应用中创建以下通知:
int notificationId = 001;
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.icon)
.setContentTitle(StationUtils.getStationModeString("My Notification")
.setContentText("Good Notification");
NotificationManager mNotifyMgr =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotifyMgr.notify(notificationId, notificationBuilder.build());
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(MainActivity.this);
notificationManager.notify(notificationId, notificationBuilder.build());
它出现在我的手机上,但没有出现在我手机连接的手表上。Android磨损所需的代码中是否缺少一些东西?它必须是签署的版本吗?我检查了设置,手表确实可以访问通知。
谢谢
如果使用Android 5.0,请确保未将Interuption设置设置为"None"
。
用"不要打扰"