3

I am using android 4.x .As I select the data from webview , there comes a option menu "copy" to copy the data on clipboard. i wanna create own button .as i click on that button it will copy the text on clipboard. i am able to copy selected text from webview to clipboard till 2.3 version. but it's not happening in android 3.0 or above.

It's measure problem.i have waste more time for it.Plz help me

My code is

public void SelectText(){ 

 try{  

   KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,       
                        KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);  
   shiftPressEvent.dispatch(mainWebView);  
 }catch(Exception e){  
      throw new AssertionError(e);  
 }  
}  
peter
  • 1,028
  • 9
  • 21
  • I am facing same problem Peter. I used https://github.com/btate/BTAndroidWebViewSelection demo. It works well for all versions. But not working in tablet. – krishna Nov 12 '13 at 05:25
  • @krishna thanks i tried above sample.. any other solution – peter Nov 12 '13 at 05:28
  • Check this : https://github.com/bossturbo/WebViewMarker. But this also shows default option menu in tablet. – krishna Nov 12 '13 at 05:30
  • http://stackoverflow.com/questions/6058843/android-how-to-select-texts-from-webview/29353049#29353049 – vikoo Mar 30 '15 at 18:01

0 Answers0