I have a broadcast reciever triggered by an alarm event, which checks if the application is being idle (user is not active). Now I would like to reset the activity stack and bring the application to the first / default activity.
But If I do something like this:
Intent intent = new Intent(context, StartUp.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_FROM_BACKGROUND | Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
then my application comes to the foreground.
I would like to do it silently so the user will not be disrupted by my application (as aparently he is doing something else).
So my question is how do I clear the activity stack without launching an activity?