CognitiveDesire
CognitiveDesire

Reputation: 784

Can't get appView after Update to cordova 5.1 from 3.4

I updated my app to cordova 5.1 recently and I am unable to make web request from JS.

The only problem during compiling was inside onCreate function of my class that extends CordovaActivity

I used to do this

super.appView.getSettings().setAppCacheEnabled(false)

now it says cast it... I tried (WebView)super.appView but app crashed as its illegal cast

I read This link and tried to do the same (WebView)super.appView.getEngine().getView() but I am still not able to make a web request.... on iOS/Desktop chrome it works fine so nothing is wrong in JS code

Upvotes: 4

Views: 1381

Answers (1)

Ángel B.
Ángel B.

Reputation: 353

You have to get the WebView from the Cordova engine.

WebView webView = (WebView) appView.getEngine().getView();

Upvotes: 2

Related Questions