通知を作成するために使用するコードを次に示します。v4 互換ライブラリを使用します。ご覧のとおり、起動するアクティビティを変更する場合は、PentingIntent を再作成する必要があります。私が行ったように、インテントをキャンセルして再発行しても問題はありません。チケットのテキストを許可していない場合、ユーザーはそれに気付かない可能性があります。また、互換性ビルダーを使用するとカスタムビューを割り当てることができることはわかっていますが、これは毎回クラッシュするため、直接割り当てる方が安定しているようです。
public static void setupNotification(Context context) {
    if (mNotificationManager == null) {
        mNotificationManager = (NotificationManager) context.getSystemService(Service.NOTIFICATION_SERVICE);
    }
    mNotificationManager.cancel(R.layout.main);
    int icon = R.drawable.ic_stat_notify_connected;
    String tickerText = context.getString(R.string.TickerText);
    createNotification(context, tickerText, icon);
    mNotificationManager.notify(R.layout.main, mNotification);
}
private static void createNotification(Context context, String tickerText, int icon) {
    Intent notificationIntent = new Intent();
    notificationIntent = new Intent(context, NotificationOptionsActivity.class);
    String contentTitle = context.getString(R.string.MessageTitle);
    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, Intent.FLAG_ACTIVITY_NEW_TASK);
    if (mNotification == null) {
        mNotification = new NotificationCompat.Builder(context.getApplicationContext()).setContentTitle(contentTitle).setSmallIcon(icon).setContentIntent(contentIntent).build();
        mNotification.flags |= Notification.FLAG_ONGOING_EVENT;
        RemoteViews contentView = new RemoteViews(context.getApplicationContext().getPackageName(), R.layout.notification_custom_layout);
        mNotification.contentView = contentView; 
    } else {
        mNotification.contentIntent = contentIntent;
    }
}
注:Intent.FLAG_ACTIVITY_NEW_TASK他に何も使用しないと機能しません。カスタム ビューがない場合は、カスタム ビューのコードを削除できます。
カスタム ビューがある場合は、次のように値を設定できます。
    mNotification.contentView.setTextViewText(R.id.noti_user, user);
    //default image
    mNotification.contentView.setImageViewResource(R.id.noti_image, R.drawable.ic_user_icon);