我正在尝试在通知栏上显示表情符号。
这是我的字符串:
"\ue057 " + getString(R.string.notification_sent_hey)
我已经尝试过使用 Softbank,以及每种可能的格式:“U+1F601”、“\xF0\x9F\x98\x81”
我应该怎么办?
Thanks.
你不能那样做。通知有一个布局,您被迫使用该布局。
一个大图标、文本和一个小图标。就是这样。这里已经说得很清楚了:http://developer.android.com/design/patterns/notifications.html http://developer.android.com/design/patterns/notifications.html
因此,您可以按照此处解释的示例进行操作:http://developer.android.com/training/wearables/notifications/creating.html http://developer.android.com/training/wearables/notifications/creating.html
例如:
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_event)
.setContentTitle(eventTitle)
.setContentText(eventLocation)
.setLargeIcon(R.drawable.ic_event2);
.setContentIntent(viewPendingIntent);
// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
// Build the notification and issues it with notification manager.
notificationManager.notify(notificationId, notificationBuilder.build());
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)