AnchorFreePartner / hydrasdk-demo-android

Hydra VPN SDK demo app for Android
https://developer.anchorfree.com/
60 stars 31 forks source link

i getting webview issue #157

Closed Jaymin-Bhadani closed 2 years ago

Jaymin-Bhadani commented 2 years ago

Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 : Current process com.test.test.test.test:my.custom.vpn

timoshenkoav commented 2 years ago

dont use webview from another process.

Jaymin-Bhadani commented 2 years ago

but we required webview for other process

timoshenkoav commented 2 years ago

so configure it to make it work on multiple processes if you need it to, its limitation of webview to run on main process only. Why do you need it to run on background process?

timoshenkoav commented 2 years ago

i guess you use some webview methods on application#onCreate - which is called for all application processes

Jaymin-Bhadani commented 2 years ago

i requred for MobileAds.initialize(this);

timoshenkoav commented 2 years ago

so limit this call to main process only. and dont call it on another processes

Jaymin-Bhadani commented 2 years ago

can you tell how i config for multiple process .?

Jaymin-Bhadani commented 2 years ago

any example do you have that i understand better way

timoshenkoav commented 2 years ago

if (ProcessUtils.isMainProcess(this)) { MobileAds.initialize(this); }

Jaymin-Bhadani commented 2 years ago

thanks for helping it saved my day

Jaymin-Bhadani commented 2 years ago

can it same work for custom webview which i created in xml for privacy policy load .?

timoshenkoav commented 2 years ago

sure

timoshenkoav commented 2 years ago

your activities are created only on main process. only application#onCreate is called on both

Jaymin-Bhadani commented 2 years ago

application#onCreate

if (ProcessUtils.isMainProcess(this)) { webView.loadUrl(Url); }

like this .?

timoshenkoav commented 2 years ago

do you call webView.loadUrl(Url); inside application onCreate method? if so yes

Jaymin-Bhadani commented 2 years ago

yes in activity#oncreate on btn click to load privacy policy

timoshenkoav commented 2 years ago

so its not in application#onCreate method. so you dont need to do this check

Jaymin-Bhadani commented 2 years ago

thanks for helping