crosswalk-project / crosswalk

A web runtime built on Chrome. This project is currently unmaintained.
https://crosswalk-project.org/blog/crosswalk-final-release.html
BSD 3-Clause "New" or "Revised" License
2.33k stars 652 forks source link

Can't XWalkView(this) in service #4029

Open tulssinep opened 6 years ago

tulssinep commented 6 years ago

I have a service containing a webView. I want to move to XWalkView.

However, when doing webView = new XWalkView(this); in my service it throws the following: java.lang.RuntimeException: java.lang.ClassCastException: es.packageName.appName.ServiceWithWebView cannot be cast to android.app.Activity

Using the normal Android WebView in the service works without issues but I now need the XWalkView.

Maybe launch an invisible activity to have something to pass to the constructor? Has anyone done something like this before?