I've applied Remoteview to notification. It works when user is in foreground, but when user is in background, notification is not showed as remoteview.
How can I apply remoteview when user is background?
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.doggy_downgrade3)
.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
.setContentTitle("Doggy")
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setNumber(1)
.setPriority(Notification.PRIORITY_MAX)
.setContent(remoteViews)
.setContentIntent(pendingIntent);
The above is my code for building a notification.