Ejemplo n.º 1
0
  @Override
  public void onDestroy(Activity activity) {
    TiUIWebView webView = (TiUIWebView) peekView();
    if (webView == null) {
      return;
    }

    // We allow JS polling to continue until we exit the app. If we want to stop the polling when
    // the app is
    // backgrounded, we would need to move this to onStop(), and add the appropriate logic in
    // onResume() to restart
    // the polling.
    webView.destroyWebViewBinding();

    WebView nativeWebView = webView.getWebView();
    if (nativeWebView == null) {
      return;
    }

    nativeWebView.stopLoading();
    super.releaseViews();
  }