How can I bring an activity to the front from a background service

android

Solution

Call `getApplicationContext()` in your `Service` which will give you a `Context` and then launch the target `Activity` as usual.

Problem

First of all, I am aware my issue is against the philosophy of Android, but I have no choice, this application will run on a embedded car gps and I need to bring an activity to prevent from car accident, for example, when it's happen around the user. I have to put other activity on the back and bring my alert pop up without user manipulation like notification on the front. Is there a way to bring manually an activity to the front, by resuming it like when you click on the android task switcher?

Original source