如何仅在状态栏上显示通知图标

时间:2017-05-05 07:28:25

标签: android android-notifications

我想在状态栏上显示一个通知图标,其中的文字不在通知抽屉上(如GPS图标)。目前我使用以下代码:

NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(CallReportAppApplication.getInstance().getApplicationContext())
        .setSmallIcon(R.drawable.ic_bell)
        .setTicker("Test");
notificationManager.notify(1, mBuilder.build());

0 个答案:

没有答案