通知无效()

时间:2016-08-11 15:25:29

标签: android notifications

我的代码就像这个`

string ns = Context.NOTIFICATION_SERVICE;

            NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
            Notification notif = new Notification(R.drawable.icon,"Meraba",System.currentTimeMillis());
            notif.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL;
            notif.priority =Notification.PRIORITY_DEFAULT;
            notif.ledARGB = 0xFFff0000;;
            notif.ledOnMS = 1000;
            notif.ledOffMS = 300;
            notif.visibility = Notification.VISIBILITY_PUBLIC;
            Context mContext = getApplicationContext();
            CharSequence contonTitle = "Bildirimim";
            CharSequence contenText = "Led Deneme";
            Intent notificationIntent = new Intent(MainActivity.this,MainActivity.class);
            PendingIntent contentIntend = PendingIntent.getActivity(MainActivity.this,0,notificationIntent,0);
            notif.contentIntent = contentIntend;
            mNotificationManager.notify(Notification_Id,notif);`

然后我收到此错误

Invalid notification (): pkg=com.harun.ledcontroler id=1 notification=Notification(pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0x00000000 vis=PRIVATE)

0 个答案:

没有答案