delight-im / Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
MIT License
2.39k stars 574 forks source link

not working setListener this this #134

Closed erlangparasu closed 7 years ago

erlangparasu commented 7 years ago

i use android.support.v4.app.Fragment

giacomomasseron commented 6 years ago

Same error here.

Cannot resolve method setListener()....

ocram commented 6 years ago

Well, the setListener method expects an Activity or android.app.Fragment instance in the first argument and an AdvancedWebView.Listener instance in the second argument, as documented.

The second argument should not be a problem. You simply have to implement that interface in your Activity or Fragment class.

For the first argument, the documentation shows that you need to use getActivity() if you’re using android.support.v4.app.Fragment.

If the setListener method cannot be resolved at all, make sure you actually declared the variable holding your WebView instance as AdvancedWebView and not just WebView.