如何在android 5中设置通知的状态栏图标

时间:2015-07-22 05:29:56

标签: android notifications statusbar

我发送通知:

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
        mBuilder.setSmallIcon(R.drawable.icon2);
        mBuilder.setContentTitle(title);
      mBuilder.setColor(getResources().getColor(R.color.smalNotificationBackground));
        mBuilder.setAutoCancel(true);
        mBuilder.setContentText(text);
     mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
        mBuilder.setContentIntent(resultPendingIntent);
        int mNotificationId = i+900;
        NotificationManager mNotifyMgr =
                (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        mNotifyMgr.notify(mNotificationId, mBuilder.build());

当它出现在状态栏中时,我只看到白色方块,如何设置我的应用程序图标? 当屏幕锁定时,通知我的图标就可以了。

0 个答案:

没有答案