Hi,
I have an API call that returns html code (referred in the code as to FullResponseText) that contains css references but the css file itself isn't returned. e.g:
I made a copy of the css file and saved it in the Files folder. The aim is for the webview to use the css file.
This doesn't work [it doesn't break, but the CSS doesn't seem to load]:
This equivalently doesn't work: [using the webviewassetfile sub floating around here on the forum] -- again it doesn't break, just doesn't do anything.
Suggestions please? (also be specific if possible, telling me to insert java isn't something I really understand, so just to save time for everyone, be specific pls.)
Thnx
I have an API call that returns html code (referred in the code as to FullResponseText) that contains css references but the css file itself isn't returned. e.g:
HTML:
</p><h2><span class="mw-headline" id="Get_in">Get in</span></span></h2><h3><span class="mw-headline" id="By_car">By car</span></span></h3>
I made a copy of the css file and saved it in the Files folder. The aim is for the webview to use the css file.
This doesn't work [it doesn't break, but the CSS doesn't seem to load]:
B4X:
Dim FullResponsePre As String : FullResponsePre = "<!DOCTYPE html><html><head><link rel=" & QUOTE & " stylesheet " & QUOTE & " href=" & QUOTE & "wikipedia.css" & QUOTE & "></head><body>"
Dim FullResponsePost As String : FullResponsePost = "</body></html>"
HTMLContentView.LoadHtml(FullResponsePre & FullResponseText & FullResponsePost)
This equivalently doesn't work: [using the webviewassetfile sub floating around here on the forum] -- again it doesn't break, just doesn't do anything.
B4X:
HTMLContentView.LoadHtml($"<!DOCTYPE html><html><head><link rel="stylesheet" href="${WebViewAssetFile("wikipedia.css")}"/> </head><body>"$ & FullResponseText)
Suggestions please? (also be specific if possible, telling me to insert java isn't something I really understand, so just to save time for everyone, be specific pls.)
Thnx