在 Android Wear 设备上显示我们的申请通知
Show Our Application Notification On Android Wear Device
我想在 Android Wear 设备上显示我的申请通知。为此,我创建了一个这样的新通知
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 磨损创建单独的通知。您的设备通知将自动出现在 android wear 上。总之,你什么都不用做。
我想在 Android Wear 设备上显示我的申请通知。为此,我创建了一个这样的新通知
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 磨损创建单独的通知。您的设备通知将自动出现在 android wear 上。总之,你什么都不用做。