how to get html content from a webview?

后端 未结 12 1765
鱼传尺愫
鱼传尺愫 2020-11-22 04:29

Which is the simplest method to get html code from a webview? I have tried several methods from stackoverflow and google, but can\'t find an exact method. Please mention an

12条回答
  •  忘了有多久
    2020-11-22 04:55

    One touch point I found that needs to be put in place is "hidden" away in the Proguard configuration. While the HTML reader invokes through the javascript interface just fine when debugging the app, this works no longer as soon as the app was run through Proguard, unless the HTML reader function is declared in the Proguard config file, like so:

    -keepclassmembers class  {
        public *; 
    }
    

    Tested and confirmed on Android 2.3.6, 4.1.1 and 4.2.1.

提交回复
热议问题