开发者

Activity crashes on HTC phones, possibly due to WebSettings

开发者 https://www.devze.com 2023-03-06 20:12 出处:网络
I am using this function to load data into WebViews in one of my activities. private void addHtml(final String text, View root, int id){

I am using this function to load data into WebViews in one of my activities.

private void addHtml(final String text, View root, int id){
    final WebView mainText = (WebView) root.findViewById(id);
    mainText.getSettings().setJavaScriptEnabled(true);
    mainText.getSettings().setAllowFileAccess(true);
    mainText.getSettings().setPluginsEnabled(true);
    mainText.loadDataWithBaseURL(null, text, "text/html", "UTF-8", null);
}

I don't have an HTC phone to test with, so I don't know exactly where the force close is occurring, but I believe it is originating in this function. Do HTC phones have issue开发者_如何学JAVAs with JavaScript or plugins in WebViews?


No, they don't as long as I know. I've written a couple of apps that do exactly the same and they work fine on my HTC.

Is it crashing on all HTC phones? Or maybe is it related to the OS version?


To say a brand is guilty is only an excuse I have heard NetFlix use. :o) It sounds like it may be due to specific settings of the user. Do you have any consistency in your reports from your panel?

Also, is the javascript editing the 'text' object?

0

精彩评论

暂无评论...
验证码 换一张
取 消