I want to customize Textselection dialog of webview.(When we press longclick at that time appear)
Do you have any idea?
I want to customize Textselection dialog of webview.(When we press longclick at that time
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think you can customize that. Android 2.2 and below don’t even support the long click response function ( i.e. nothing happens when you long press).
Long click is supported for WebView on Android 2.3+ and brings up the “copy and paste” dialog, but webview implements it by temporarily setting itself into WebTextView mode which allows user to select words to clipborad. The dialog you see when the long press is brought up at that time. WebView.performLongClick()
Since WebTextView is a private class, there is no way you can access it. So, I think even if you can override the onPerformLongClick() method and prevent the dialog from showing up, you can’t get the dialog and customize it.