觸摸我設置在我的Android應用程序像這樣的通知:Android開放式的應用程序與此刻的通知
private Notification getNotification(String content) {
Notification.Builder builder = new Notification.Builder(this);
builder.setContentTitle(getString(R.string.app_name));
builder.setContentText(content);
builder.setTicker(content);
builder.setSmallIcon(R.drawable.ic_notification_appicon);
builder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
builder.setDefaults(Notification.DEFAULT_VIBRATE);
builder.setAutoCancel(true);
builder.setLights(Color.GREEN, 500, 500);
return builder.getNotification();
}
的問題是,我想按上應該打開應用程序的通知。但如果我觸及通知,則什麼都不會發生。 有什麼想法?