Java 在Android Wear设备上显示我们的应用程序通知
我想在Android Wear设备上显示我的应用程序通知。为此,我创建了一个新通知,如下所示Java 在Android Wear设备上显示我们的应用程序通知,java,android,notifications,push-notification,Java,Android,Notifications,Push Notification,我想在Android Wear设备上显示我的应用程序通知。为此,我创建了一个新通知,如下所示 Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender().setHintHideIcon(tru
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender().setHintHideIcon(true).setBackground(bmp);
Notification notif = new NotificationCompat.Builder(mContext).setContentTitle(title).setContentText(msgText).setSmallIcon(R.drawable.ic_launcher).extend(wearableExtender).build();
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(mContext);
notificationManager.notify(notificationId, notif);
但我在设备上收到两个通知。请任何人提供帮助。无需为android wear创建单独的通知。您的设备通知将自动出现在android wear上。简而言之,你不需要做任何事情。你确定我们不需要为android wear设备创建单独的通知吗??“当android手持设备(手机或平板电脑)和android wear-able连接时,手持设备会自动与穿戴设备共享通知。”这是