@SuppressWarnings({"deprecation", "ResourceType"}) protected void createViews() { // Why are we setting a constant as the ID? This should be investigated webView.getView().setId(1000); RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); webView.getView().setLayoutParams(p); if (preferences.contains("BackgroundColor")) { int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK); // Background of activity: webView.getView().setBackgroundColor(backgroundColor); } webView.getView().requestFocusFromTouch(); }