android - How to start activity from background service -


i have voip application after it's being swept away recent apps should show activity when receive call. there background service should create activity, after swiping app away that's not possible.

so, how start activity background service in case?

first of all, need ui thread handler. in activity class:

private final handler h = new handler(); 

then, pass handler background service, , next:

handler.post(new runnable() {        public void run() {          //startactivity        }     }); 

read handler here handler, such message queue of thread. post message queue, , processed possible


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -