Closed jflamman closed 9 years ago
Thanks!
This was actually intended behaviour, as there are two ways to implement the listener:
Activity
or Fragment
classYou don't need both ways, of course.
Adding the methods to the Activity
or Fragment
class was correct. And then you can remove the anonymous class from setListener()
and just call it with this, this
.
Does that help?
The documentation was poor, you're right. Has been fixed with https://github.com/delight-im/Android-AdvancedWebView/commit/8252c4e3808f5b31c9c1dbf37b0cd31e6472ccb5
OK, that helps! I'm not a Java geek and I wasn't sure my workaround was a hack or an allowed way to make things work. :-)
mWebView.setListener(this, this); is already there, so I guess that takes care of it then.
Thank you for all your work & your quick responses..
Great! That's fine, now things have been clarified :)
The README was definitely confusing before. Thanks for pointing out!
Glad to be of help, keep up the good work!
Following the steps in the readme, Android Studio still threw warnings the Activity must be either abstract or implement AdvancedWebView's Listener methods.
It stopped complaining when I copied the methods from mWebView.setListener to the Activity class and commented out the mWebView.setListener part in onCreate altogether.
(I added the Intent to onExternalPageRequest to be able to have external links open in my phone's browser)