Android: Unclicked notification timeout
<p>I'm launching a notification on the weekend. If the notification is not seen/clicked after a certain time, I would like it to disappear by itself.
I couldn't find any way to set a timeout or something of the sort within the <code>NotificationCompat.Builder</code> expression. Here is the (quite normal notification builder) code:</p>

<pre><code>Intent myIntent = new Intent(context, MyActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);

NotificationCompat.Builder mBuilder =
        new NotificationCompat.Builder(context)
                .setSmallIcon(R.drawable.not_bar_small_icon)
                .setColor(ContextCompat.getColor(context, R.color.Green))
                .setContentTitle(context.getResources().getString(R.string.strNotificationTitle))
                .setContentText(context.getResources().getString(R.string.strNotificationMessage))
                .setContentIntent(pendingIntent);

NotificationManager notifyManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
notifyManager.notify(MY_NOTIFICATION_ID, mBuilder.build());
</code></pre>

<p>Can this be done?</p>

<p><strong>Solution Update:</strong></p>

<p>Solved using Aleksandar's link suggested in the comment below.</p>