I am trying to create a WebView dynamically using the following code:
mWebView = new WebView(this);
mWebView.setId(R.id.webview);
mWebView.setVerticalScrollBarEn
below code works fine Android 3.0+ but when you try this code below android 3.0 then your app forcefully closed.
webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
You try below code on your less then API 11.
webview.setBackgroundColor(Color.parseColor("#919191"));
Or
you can also try below code which works on all API fine.
webview.setBackgroundColor(Color.parseColor("#919191"));
if (Build.VERSION.SDK_INT >= 11) {
webview.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
}
above code use full for me.