Home > Mobile >  H5 embedded in the form of a link to the APP in loading speed is slow
H5 embedded in the form of a link to the APP in loading speed is slow

Time:03-12

H5 embedded in the form of a link to the APP in loading speed is slow, the content is dynamic, there are 9 images, how to solve the problem of load slow this? Pray god to solve!

CodePudding user response:

1 you can set the cache, slow start for the first time in certain loading
 
//to improve web page loading speed, temporarily blocking loading images, then the page load, in the loading pictures
WebSettings. SetBlockNetworkImage (true);
//open the caching mechanism
WebSettings. SetAppCacheEnabled (true);

/* *
* page load to complete the callback method
*
* @ param view
* @ param url
*/
@ Override
Public void onPageFinished (WebView view, String url) {
Super. OnPageFinished (view, url);
The I (" shendi ", "-- -- -- -- -- -- -- -- & gt; OnPageFinished url: "+ url);
//the current global convenient url assignment control car rental infinite loop
CurrentMyselfUrl=url;
//to monitor the current url to end the death of the rv cycle
If (currentMyselfUrl!=null) {
SetObserverUrlCallback (currentMyselfUrl);
}
If (isRefresh) {
IsRefresh=false;
}
//loaded hidden progress interface, display the WebView content

MContentView. SetVisibility (the VISIBLE);
//close the image loaded block
The getSettings (.) setBlockNetworkImage (false);
//loaded after creating the listener to interact with js data
If (mJSdataCallback!=null) {

MJSdataCallback. JSageFinish ();
}

}



2 nested in the form of links. You can also put the pictures in addition to the information in the webview and dig out the part with the native images, through uir behind joining together the key value of interactive image resources

CodePudding user response:

Same as above, can you solve it
  • Related