我正在使用以下代码在我的 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);