Home NotificationCompat.Builder does not set Large and small icon
Reply: 0

NotificationCompat.Builder does not set Large and small icon

Sahana Kamath
1#
Sahana Kamath Published in 2017-09-14 04:58:51Z

This is how I am setting the icons. However both the icons are not set. The default Android icon is shown for the large icon. How do I solve this?

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
                .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher))
                .setSmallIcon(R.drawable.ic_alarm_on_white_24dp)
                .setContentTitle(context.getResources().getString(R.string.app_name))
                .setTicker(mTitle)
                .setContentText(mTitle)
                .setContentIntent(mClick)
                .setAutoCancel(true)
                .setOnlyAlertOnce(true);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316346 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO