如何删除android studio应用程序中的小通知图标

时间:2017-02-11 13:57:19

标签: android notifications

我正在构建一个Android应用,它会在运行时显示通知。但通知图标并不是全尺寸。这是代码和它的图像。

NotificationCompat.Builder notificationBuilder=new
NotificationCompat.Builder(getActivity())
            .setContentTitle(title)
            .setContentText(text)
            .setSmallIcon(R.mipmap.ic_launcher);

enter image description here

当我设置'大图标'时,它需要完整的尺寸。

 .setSmallIcon(R.mipmap.ic_launcher)  
 .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher))

enter image description here

我想要做的是,删除小图标,只保留显示为较大图标的大图标。但是如果我删除了#set; setLargeIcon(int)'并保持< setLargeIcon(bigmap)',app不会显示任何通知。因此,为了获得通知,我必须保留两个图标。 任何人都可以为此提供解决方案。我怎样才能只保留大图标?

0 个答案:

没有答案