Backbutton v5.0.4/v5.0.5 in Tab View Application not exit

in Tab View Application not exit.

v5.0.4/v5.0.5

  /*
  This method prevents back button tap to exit from app on android.
  In case there is an opened modal it will close that modal instead.
  In case there is a current view with navigation history, it will go back instead.
  */

handleAndroidBackButton: function () {
var f7 = cordovaApp.f7;
const $ = f7.$;
if (f7.device.electron) return;

document.addEventListener('backbutton', function (e) {
  if ($('.actions-modal.modal-in').length) {
    f7.actions.close('.actions-modal.modal-in');
    e.preventDefault();
    return false;
  }
  if ($('.dialog.modal-in').length) {
    f7.dialog.close('.dialog.modal-in');
    e.preventDefault();
    return false;
  }
  if ($('.sheet-modal.modal-in').length) {
    f7.sheet.close('.sheet-modal.modal-in');
    e.preventDefault();
    return false;
  }
  if ($('.popover.modal-in').length) {
    f7.popover.close('.popover.modal-in');
    e.preventDefault();
    return false;
  }
  if ($('.popup.modal-in').length) {
    f7.popup.close('.popup.modal-in');
    e.preventDefault();
    return false;
  }
  if ($('.login-screen.modal-in').length) {
    f7.loginScreen.close('.login-screen.modal-in');
    e.preventDefault();
    return false;
  }

  const currentView = f7.views.current;
  if (currentView && currentView.router && currentView.router.history.length > 1) {
    currentView.router.back();
    e.preventDefault();
    return false;
  }

  if ($('.panel.panel-in').length) {
    f7.panel.close('.panel.panel-in');
    e.preventDefault();
    return false;
  }
}, false);

},

v4.4.7

  /*
  This method prevents back button tap to exit from app on android.
  And allows to exit app on backbutton double tap
  */
  handleAndroidBackButton: function () {
    var f7 = cordovaApp.f7;
    if (f7.device.electron) return;
    cordovaApp.backButtonTimestamp = new Date().getTime();
    document.addEventListener('backbutton', function (e) {
      if (new Date().getTime() - cordovaApp.backButtonTimestamp < 250) {
        cordovaApp.backButtonTimestamp = new Date().getTime();
        if (window.navigator.app && window.navigator.app.exitApp) {
          window.navigator.app.exitApp();
        }
        return true;
      }
      cordovaApp.backButtonTimestamp = new Date().getTime();
      e.preventDefault();
      return false;
    }, false);
  },

https://forum.framework7.io/t/android-9-backbutton/8267/6

Thank You Sir but its not work for me.
i am trying step by step Like…

  1. FInd and replace SplashScreen.java
  2. cordova plugin remove cordova-plugin-splashscreen
  3. cordova plugin add cordova-plugin-splashscreen

merge function old with new
Function its work for me. But 1 issue m facing while page position is 2nd (examply)

if current page is listing and i push to click for listing detail page its work done Know while open popup, Dialog,Select and Sheet etc… in Detail page and click to back button would take me straight to the list page not in Detail page.

handleAndroidBackButton: function () {
    var f7 = cordovaApp.f7;
    const $ = f7.$;
    if (f7.device.electron) return;
    cordovaApp.backButtonTimestamp = new Date().getTime();
    document.addEventListener('backbutton', function (e) {
      if ($('.actions-modal.modal-in').length) {
        f7.actions.close('.actions-modal.modal-in');
        e.preventDefault();
        return false;
      }
      if ($('.dialog.modal-in').length) {
        f7.dialog.close('.dialog.modal-in');
        e.preventDefault();
        return false;
      }
      if ($('.sheet-modal.modal-in').length) {
        f7.sheet.close('.sheet-modal.modal-in');
        e.preventDefault();
        return false;
      }
      if ($('.popover.modal-in').length) {
        f7.popover.close('.popover.modal-in');
        e.preventDefault();
        return false;
      }
      if ($('.popup.modal-in').length) {
        f7.popup.close('.popup.modal-in');
        e.preventDefault();
        return false;
      }

      const currentView = f7.views.current;
      if (currentView && currentView.router && currentView.router.history.length > 1) {
        currentView.router.back();
        e.preventDefault();
        return false;
      }
      if ($('.panel.panel-in').length) {
        f7.panel.close('.panel.panel-in');
        e.preventDefault();
        return false;
      }
      if (new Date().getTime() - cordovaApp.backButtonTimestamp < 250) {
        cordovaApp.backButtonTimestamp = new Date().getTime();
        if (window.navigator.app && window.navigator.app.exitApp) {
          f7.dialog.confirm('Are you sure you want to close this activity?', function () {
            setTimeout(() => {
              window.navigator.app.exitApp();
            }, 1000);
          });
        }
        return true;
      }
      cordovaApp.backButtonTimestamp = new Date().getTime();
      e.preventDefault();
      return false;
    }, false);
  },