title: Cordova backbutton destroy the CordovaActivity after use own plugin
body: <p>I develop a cordova plugin that can create a file container for pdf. My Plugin have the functions <code>enterFullscreen()</code> and <code>exitFUllscreen()</code>. If i switch to Fullscreen and want back to defaut file container i want use the backbutton for this, but if i press the backbutton the app close. In my logcat i get this message: </p>
  
  <p><a href="https://i.stack.imgur.com/rypBP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rypBP.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Here is my plugin code: java</strong></p>
  
  <pre><code>/**
   * Enters the fullscreen mode of a Container.
   *
   * @param {Container} _container The Container which should enter the fullscreen mode.
   * @param {boolean} _enableFullscreen True for enabling fullscreen mode, false for disabling.
   */
  private void setContainerFullscreen(final Container _container,final boolean _enableFullscreen)
  {
      Log.d(LOGTAG,"FileViewer -&gt; enterFullscreen of container with id: " + _container.id());
  
      this.cordova.getActivity().runOnUiThread(new Runnable()
      {
          @Override
          public void run()
          {
              _container.enableFullscreen(_enableFullscreen);
  
              FrameLayout containerLayout = _container.containerFrameLayout();
  
              /* first we must call removeView() then addView(), because the updateView() function don't work with fullscreen mode.
              //todo I must check this later.
              call a exception.*/
              mainLayout.removeView(containerLayout);
              mainLayout.addView(containerLayout,containerLayout.getLayoutParams());
          }
      });
  }
  </code></pre>
  
  <p><strong>here the container class</strong></p>
  
  <pre><code>/**
   * Enables fullscreen mode for this Container.
   *
   * @param {boolean} _enable True for enabling fullscreen mode, false for disabling.
   */
  public void enableFullscreen(boolean _enable)
  {
      this.isFullscreen = _enable;
  
      if (this.isFullscreen &amp;&amp; this.isVisible)
      {   // Sets the size of the parentlayout to fullscreen.
          this.containerFrameLayout.setLayoutParams(mainLayout.getLayoutParams());
          this.enableToolbar(true);
      }
      else if (!this.isFullscreen &amp;&amp; this.isVisible)
      {   // Sets the size back to the values before it went into fullscreen mode.
          FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(this.containerRect.right-this.containerRect.left,this.containerRect.bottom-this.containerRect.top);
          layoutParams.leftMargin = this.containerRect.left;
          layoutParams.topMargin = this.containerRect.top;
          layoutParams.gravity = 0;
  
          this.containerFrameLayout.setLayoutParams(layoutParams);
          this.enableToolbar(false);
      }
  }
  </code></pre>
  
  <p><strong>Here is the javascript code:</strong> </p>
  
  <pre><code>// backbutton support for android in fullscreen mode
  document.addEventListener("backbutton", Ext.bind(function(_event){
      if (this.fullScreen)
      {
          //console.log("We are in fullscreen!");
          this.fileViewerPlugin.exitFullscreen();
          this.fullScreen=false;
          _event.preventDefault();
      }
      else
      {
          navigator.app.exitApp();
      }
  },this), false);
  </code></pre>