Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android webview inside a service?

I have a WebView in my android app from which a lot of javascript is getting called by our server. I want to implement a system where a signal from the server will wake up/restart the app and bring it to the front to alert the user. I know this is horribly obnoxious but in my case its necessary.

It seems that the only way to accomplish this is to have the WebView live in a Service (because Activities can be killed by the OS at any time). Does anyone know how this would work? I've read that WebViews can only reside in Activities.

Thanks!!

like image 360
TomBomb Avatar asked Oct 25 '11 04:10

TomBomb


1 Answers

TomBomb, thanks for accepting my previous answer but I think I might have something else of use for you. Instead of forcing an Activity to come into the foreground, why not use a Status Bar Notification to let your users know something new from the server has come in?

like image 128
Kurtis Nusbaum Avatar answered Nov 10 '22 10:11

Kurtis Nusbaum