Translate

Wednesday, November 29, 2017

Notification icon displaying as white color in Android-O/26


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

without opening the notification

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.

Could not identify launch activity: Default activity not found : Error while Launching activity

Problem : I got this Error , When I tried to create an application without any Activity . Basically like to develop an Android Headless appl...