I am having a problem in copy-paste on long click on text inside my class extending Android WebView.
I'm able to copy, but paste is not working. While investigating, somewhere on net got suggestion to look into android.webkit.WebViewClassic.
In WebViewClassic, there's a method named pasteFromClipboard(). I think actual pasting of code happens in that method, but not sure.
So can anyone please tell me Am I right, i.e. whether investigating in WebViewClassic is worth for me?
If yes, please tell me what is relation between WebView and WebViewClassic, i.e. how long click in WebView goes to WebViewClassic.
And sorry, I cant expose my code or log.
WebViewClassic is the default WebViewProvider for WebView. From the implementation notes:
The WebView is a thin API class that delegates its public API to a backend WebViewProvider
class instance. WebView extends {@link AbsoluteLayout} for backward compatibility reasons.
Methods are delegated to the provider implementation: all public API methods introduced in this
file are fully delegated, whereas public and protected methods from the View base classes are
only delegated where a specific need exists for them to do so.
Basically, touch handling is forwarded from the WebView to a WebViewClassic instance. If you read through it's onTouchEvent implementation, and its inner WebViewInputDispatcher implementation PrivateHandler
you can trace where the touch handling will lead to a call to pasteFromClipboard()
on the WebViewClassic instance.
So yes, you are correct. When you tap the paste button on the PastePopupWindow, there will be a call to WebViewClassic's pasteFromClipboard();
method.