Android Question Framework7 In Webview Issue

xor83

Member
Licensed User
Longtime User
Hello,

I Created a project and added a webview and loaded index.html file, Index file is loaded without any issues but when I try to click on any link its just stuck at preloader image and does not load and other page though pages works fine on desktop. Can anyone help me on this? Do I have to do anything else to load other pages?

I am attaching Framework7 html files so you can take look.
Download: https://drive.google.com/file/d/0BxvoKXO_7hw_dlJlQWtlVVNoNEU/view?usp=sharing
Frmework7 Website: http://framework7.io

This is code I written for webview:

B4X:
 WebView1.Initialize("WebView1")  
   WebView1.JavaScriptEnabled=True
   'WebViewExtras1.addJavascriptInterface(WebView1, "B4A") ' NOT ESSENTIAL
 
   WebViewExtras1.addWebChromeClient(WebView1, "MyEventName")
   WebViewSetting1.setDatabaseEnabled(WebView1, True)
   WebViewSetting1.setDisplayZoomControls(WebView1, False)
   WebViewSetting1.setLightTouchEnabled(WebView1,False)
   WebViewSetting1.setDatabaseEnabled(WebView1, True)
   WebViewSetting1.setDOMStorageEnabled(WebView1, True)
   WebViewSetting1.setAllowFileAccess(WebView1,True)
   WebViewSetting1.setJavaScriptCanOpenWindowsAutomatically(WebView1,True)
   WebViewSetting1.setSupportZoom(WebView1,False)
   Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
  
  
   WebView1.LoadUrl("file:///android_asset/index.html")
 

xor83

Member
Licensed User
Longtime User
Thanks Erel for the reply:

While debugging in B4A I got cross-origin error due to Ajax call for internal pages, I googled and found some suggestions installing webserver and host pages in that webserver. Some also suggest setAllowFileAccess but that did not worked. Can you please tell me what is the best way to make this work in B4A?
 
Upvote 0

xor83

Member
Licensed User
Longtime User
Yes, I too agree with you that android app should be created using native layout but I am using these HTML layouts for demo purpose. Anyways, There is an option to create pages inline/cached(In framework7) which does not require Ajax call which worked for me :). Thanks for the help :)
 
Upvote 0
Top