본문 바로가기
공부하는 하스씨/안드로이드

숨겨진 메소드 호출 트릭

by 박하스. 2010. 4. 28.
728x90
반응형

From the class that extends WebView:

public void selectAndCopyText() { 
   
try { 
       
Method m = WebView.class.getMethod("emulateShiftHeld", null); 
        m
.invoke(this, null); 
   
} catch (Exception e) { 
       
throw new AssertionError(e);
   
} 
} 

And then you have to use ClipboardManager to watch for new text.

P.S. Historical note: this hack is based on Android 1.5 WebView implementation.

728x90
반응형