I have used following code to display the notification .
But it is working in all Android versions other than Android 26.

Following is my Code :
NotificationCompat.Builder getBaseNotificationBuilder() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(getContext(), NotificationConstants.NOTIFICATION_CHANNEL); builder.setContentTitle(getContext().getString(R.string.title)); builder.setSmallIcon(R.drawable.icon); builder.setOnlyAlertOnce(true); return builder;
}
My Solution to Fix this :
To fix this i have tried many possible solutions but none of them are working.
But strangely , tried following solution and it works perfectly.
I have moved all my notification icons from res/drawable folder to res/drawable-xxhdpi folder.
Then issue is resolved.
No comments:
Post a Comment