Skip to content Skip to sidebar Skip to footer

Opening An Static Html Page In Webchromeclient In Android Gets Added With Some More Characters In Url

I am getting error as The Web Page at file:///#/android_asset/webpage.htm could not be loaded as: Is a directory. in the emulator. but my code is webView.loadUrl('file:///android_a

Solution 1:

Oh this caused me headaches, and they changed how it worked for one of the android versions, but can't remember which. Here is what I do:

webView.loadUrl("file:/android_asset/webpage.html");

and if your static webpage has images you use this link:

file:///android_asset/yourimage.png

Edit try this: https://stackoverflow.com/a/8737547/969325, clean project and check if asset file is at path.

Solution 2:

- `You are using only htm use html` 


webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(newmyWebClient());
webview.loadurl();
and


 publicclassmyWebClientextendsWebViewClient  
         {  
             @OverridepublicvoidonPageStarted(WebView view, String url, Bitmap favicon) {  
                 // TODO Auto-generated method stub  super.onPageStarted(view, url, favicon);  
             }  

             @OverridepublicbooleanshouldOverrideUrlLoading(WebView view, String url) {  
                 // TODO Auto-generated method stub  

                 view.loadUrl(url);  
                 returntrue;  

             }  
         } 

Post a Comment for "Opening An Static Html Page In Webchromeclient In Android Gets Added With Some More Characters In Url"