Android Question error: code too large

code too large public static String _webview1_loadhtml()
You can try to reduce the length of the static string by using a lateral string which combine several other strings like
B4X: Copy
Dim FirstPart as string = $"First part of your HTML code"$
Dim SecondPart as string = $"Second part of your HTMLcode"$
Dim YourHTL as string = $"${FirstPart}${SecondPart}"$
 
Upvote 0
If your string literal is that large, I would suggest adding it as a text/html file to your files folder and then loading it into your string:
Code: Copy
psHtmlData = File.ReadString(File.DirAssets, "example.txt")
 
Upvote 0
public static String _webview1_loadhtml() throws Exception{ ^:
That's not a string literal, it's a declaration of a public method returning a String and the error is a code error that seems to occur at End Sub so I suspect that the method is too large and needs refactoring into several Subs.
 
Upvote 0
Back
Top