Я создал уведомление, и оно работает, но не отображается в Moto Display при блокировке. Я изменил приоритет, категорию и т. Д. Без эффектов. Я хочу, чтобы это уведомление как сообщения или пропущенные CALs: moto displayУведомления на дисплее Moto
Это работает как служба:
PendingIntent pendingIntent = PendingIntent.getActivity(this, requestCode /* Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.emblem2)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_help_red))
.setColor(getResources().getColor(R.color.colorFirst))
.setContentTitle(title)
.setContentText(location)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setShowWhen(true)
.setCategory(Notification.CATEGORY_ALARM)
.setLights(Color.YELLOW, 200, 200)
.setContentIntent(pendingIntent);
notificationBuilder.setVibrate((sharedPreferences.getBoolean("notifications_new_message_vibrate", false) ? new long[]{0, 300, 200, 300} : new long[]{}));
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(requestCode, notificationBuilder.build());
Возможно, ваши приложения заблокированы, хотя проверьте свою настройку ** звук и уведомление ** найдите **, когда устройство заблокировано **. –
Я проверил, и я включил его, все приложения отображаются, кроме моего, даже подписанного приложения, возможно, оно должно быть отправлено из Google Play? – Marcin
для подробной документации go [здесь] (http://developer.android.com/guide/topics/ui/notifiers/notifications.html) может быть, вы что-то пропустили. –