I am working on heads up notification. My code is working fine for all devices but not with xiaomi and LeEco like devices which are above android 5.1. My code is:
RemoteViews contentView = null;
contentView = new RemoteViews(context.getPackageName(), R.layout.demo);
final android.support.v4.app.NotificationCompat.Builder notification = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setDefaults(Notification.DEFAULT_ALL)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCustomHeadsUpContentView(contentView)
.setVibrate(new long[0])
.setCategory(Notification.CATEGORY_CALL)
.setDeleteIntent(createOnDismissedIntent(context, 2222))
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1111, notification.build());
What could be the issue?
I think this solution will be very helpfull for you, but I can't find any solution for LeEco Devices: