List of usage examples for android.webkit WebViewFragment getWebView
public WebView getWebView()
From source file:com.ohso.omgubuntu.CommentsActivity.java
@SuppressLint("SetJavaScriptEnabled") @Override/*from ww w . j a v a 2s . c o m*/ public void onCreate(Bundle instance) { super.onCreate(instance); setContentView(R.layout.fragment_comments); setTitle("Comments"); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); mArticlePath = getIntent().getStringExtra(COMMENTS_URL); mIdentifier = getIntent().getStringExtra(COMMENTS_IDENTIFIER); if (mArticlePath == null) finish(); mFragmentManager = getSupportFragmentManager(); // Setting up the default Disqus WebView WebViewFragment commentsFragment; if (instance != null) { commentsFragment = (WebViewFragment) getSupportFragmentManager().findFragmentByTag("comments"); commentView = commentsFragment.getWebView(); } else { commentsFragment = new WebViewFragment(); mFragmentManager.beginTransaction() .replace(R.id.comments_fragment_container, commentsFragment, "comments").commit(); commentView = new WebView(this); commentsFragment.setWebView(commentView); } if (commentView == null) commentView = new WebView(this); commentView.getSettings().setJavaScriptEnabled(true); commentView.getSettings().setSupportMultipleWindows(true); commentView.setWebChromeClient(new WebFragmentClient(this)); commentView.setWebViewClient(new WebClient(this)); if (instance == null) setContents(mArticlePath); }