Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Can't XWalkView(this) in service #4029

Open
tulssinep opened this issue Jun 6, 2018 · 0 comments
Open

Can't XWalkView(this) in service #4029

tulssinep opened this issue Jun 6, 2018 · 0 comments

Comments

@tulssinep
Copy link

tulssinep commented Jun 6, 2018

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?

@tulssinep tulssinep changed the title Can't XWalkView(this); Can't XWalkView(this) in service Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant