我没有得到它设法显示我根据 ElizaChat 示例所做的背景,但我没有得到它总是黑色的背景。
这是我的代码:
public static void createNotification(Context context) {
int notificationId = 1;
NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText("I am a big style message");
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(context)
//.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("hallo")
.setContentText("I am a message")
.setLargeIcon(BitmapFactory.decodeResource(
context.getResources(), R.drawable.clock_bg))
//.setStyle(bigStyle)
;
// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
Notification notification =
new WearableNotifications.Builder(notificationBuilder)
.setHintHideIcon(true)
.setMinPriority() // show only on clock
.build();
// Build the notification and issues it with notification manager.
notificationManager.notify(notificationId, notification);
}
任何想法?
这是我的输出: