Example #1
0
 /**
  * Called when the fragment is visible to the user and actively running. This is generally tied to
  * {@link Activity#onResume() Activity.onResume} of the containing Activity's lifecycle.
  */
 @Override
 public void onResume() {
   super.onResume();
   if (block != null) {
     block.onResume();
   }
 }
 /** Called when the fragment is no longer resumed. Pauses the WebView. */
 @Override
 public void onResume() {
   if (mobileBindings != null) {
     mobileBindings.saveState(null);
   }
   mWebView.onResume();
   super.onResume();
 }
 @Override
 public void onResume() {
   super.onResume();
   if (mWebView != null) {
     mWebView.onResume();
   }
   if (getTracker() != null) {
     getTracker().setScreenName("ArticleView");
     getTracker().setPage(mFeedItem.link());
   }
 }
 @TargetApi(Build.VERSION_CODES.HONEYCOMB)
 private void resumeWebView() {
   if (mWebView != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
     mWebView.onResume();
 }
 @Override
 public void onResume() {
   mWebView.onResume();
   super.onResume();
 }
 @Override
 protected void onResume() {
   super.onResume();
   if (mWebView != null) mWebView.onResume();
   MobclickAgent.onResume(this);
 }
 @Test
 public void shouldRecordOnResume() {
   assertThat(shadowWebView.wasOnResumeCalled()).isFalse();
   webView.onResume();
   assertThat(shadowWebView.wasOnResumeCalled()).isTrue();
 }
 @Override
 public void onResume() {
   super.onResume(); // To change body of overridden methods use File |
   // Settings | File Templates.
   webView.onResume();
 }
Example #9
0
 @Override
 protected void onResume() {
   super.onResume();
   if (mWebView != null) mWebView.onResume();
 }
  @SuppressLint("SetJavaScriptEnabled")
  @Override
  @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  public void onResume() {
    if (BuildConfig.DEBUG) {
      Log.d(TAG, "Resuming webview fragment");
    }
    super.onResume();

    if (resetWebview) {
      if (BuildConfig.DEBUG) {
        Log.d(TAG, "Init new webview");
      }

      // setup web view
      webView = (WebView) getView().findViewById(R.id.webview);
      WebSettings webSettings = webView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      webSettings.setBuiltInZoomControls(true);
      webSettings.setLoadWithOverviewMode(true);
      webSettings.setUseWideViewPort(true);

      // add webview handlers
      final Activity activity = getActivity();
      final ProgressBar progressBar =
          (ProgressBar) getView().findViewById(R.id.webview_progressbar);

      // set the progress bar
      webView.setWebChromeClient(
          new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
              if (BuildConfig.DEBUG) Log.d(TAG, "Page load progress : " + progress);
              progressBar.setProgress(progress);
              progressBar.setVisibility((progress == 100) ? View.GONE : View.VISIBLE);
            }
          });

      // set up error messages display
      webView.setWebViewClient(
          new WebViewClient() {
            public void onReceivedError(
                WebView view, int errorCode, String description, String failingUrl) {
              Log.e(TAG, "Error while loading webview : #" + errorCode + " : " + description);
              Toast.makeText(
                      activity, getString(R.string.webview_error, description), Toast.LENGTH_SHORT)
                  .show();
            }
          });

      // load the page
      webView.loadUrl(getString(url));

    } else if ((AppUtils.isAPILevel11Available()) && (webView != null)) {
      if (BuildConfig.DEBUG) {
        Log.d(TAG, "Resume webview");
      }
      webView.onResume();
    }

    // set title
    ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(title);
  }
 @Override
 public void onResume() {
   super.onResume();
   mWebView.resumeTimers();
   mWebView.onResume();
 }