Customizing Android Webview Class
I'm writing an Android app (android 2.3.3 / API 10) where I'm loading websites via WebView. Looking at the android.webkit.webview source code, specifically onSavePassword(...) (you
Solution 1:
Once you extended the WebView
class with your own, you should just rename every webviews in your Layout XML files by com.packagename.YourNewWebViewClass
.
in fact :
<WebViewlayout......></WebView>
Shall become
<com.mypackage.MyWebView layout....></com.mypackage.MyWebView layout>
That should do the trick !
Solution 2:
Just override.
But you should adopt a strategy of try-test-error cycle, it's a goog way to learn in IT...
Solution 3:
Why not just make your own WebViewExt
class that extends WebView
and override the function? Then use your own WebViewExt
and forget WebView
exists.
Solution 4:
why don't you create a same package as WebView in your code and put your class in that package. at runtime it will be considered to be in the same package and you will be able to use @override annotation
Post a Comment for "Customizing Android Webview Class"