There is a non public api that I need to override in order to workaround a quirk with Android\'s WebView.
The api is hidden but it is public:
/**
*
solution 1) - best what you can do here closest to what you want to achieve
// to override method
// which IDE doesn't see - those that contains {@ hide} text in JavaDoc
// simple create method with same signature
// but remove annotation
// as we don't know if method will be present or not in super class
//
//@Override
public boolean callMethod(String arg) {
// can we do it ?
// boolean result = super.callMethod(arg)
// no why ?
// You may think you could perhaps
// use reflection and call specific superclass method
// on a subclass instance.
/**
* If the underlying method is an instance method, it is
* invoked using dynamic method lookup as documented in The
* Java Language Specification, Second Edition, section
* 15.12.4.4; in particular, overriding based on the runtime
* type of the target object will occur.
*/
// but always you can see what super class is doing in its method
// and do the same by forward call in this method to newly created one
// return modified result
return doSomthingWhatSuperDo()
}
solutions 2)
does the object (which calls this method) belongs to you? and implements interface?
if so how about proxy ?