0
我正在使用下面的代碼來顯示我的android應用程序中的通知,但是使用這個,通知活動也顯示出來(即黑色的空白屏幕)我不想要這個屏幕,但只是一個簡單的通知,當用戶點擊通知時,我想啓動該活動。該代碼應該做什麼?在android中顯示通知
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify = new Notification(R.drawable.mcube_logo, "Message Sent", Calendar.getInstance().getTimeInMillis());
Intent intent = new Intent(RecieveAlarm.this, otherActivity.class);
PendingIntent pendingIntent =PendingIntent.getActivity(RecieveAlarm.this, 1, null, PendingIntent.FLAG_CANCEL_CURRENT);
notify.setLatestEventInfo(RecieveAlarm.this, "Title", "Details", pendingIntent);
notificationManager.notify(0, notify);