I'm working on an SDK for Android. As part of this SDK, I need to set my own WebViewClient
to a WebView
of an application where the WebView
and the SDK are integrated (meaning not part of my SDK).
For this reason, this WebView
might have already been set with a WebViewClient
and in this case, I need to get the instance of this WebViewClient
from the WebView
set my own WebViewClient
to it and forward the callback methods of my WebViewCleint
to the originally configured one that was set by the developer of the app.
I noticed that from API V26 there is a getWebViewClient method for the WebView
class. but obviously, I'm looking for a way to do this on previous versions as well. Maybe there is some kind of way to do this using the support libs?
Does someone know how can I get the instance of the set WebViewClient in the WebView in older versions? using Reflection or any other method?