Back to previews page with android back button

Hi. My app structure is like below :

<div id="app">
            <!-- Status bar overlay for fullscreen mode-->
            <div class="statusbar"></div>
            <!-- Views/Tabs container -->
            <div class="views tabs ios-edges">
                <!-- Your main view/tab, should have "view-main" class. It also has "tab-active" class -->
                <div id="view-home" class="view view-main tab tab-active">
                    <!-- Page, data-name contains page name which can be used in page callbacks -->
                    <div class="page" data-name="home">
                <!-- Catalog View -->
                <div id="view-catalog" class="view tab"></div>
                <!-- Settings View -->
                <div id="view-settings" class="view tab">
                    <div class="list">
                                <a href="#" class="item-content item-link popup-open" data-popup="#myadss_popup" >
            <!-- My Adss -->
            <div class="popup " id="myadss_popup">
                <div class="view">
                    <div class="page page-current" id="myadss_page">.....</div>
                    <div class="page page-next" data-name="open_edit" id="open_edit"></div>

When I click on the android back button application will close but I want to come back to the previews page. What do I have to do? For example from open_edit page to the myadss_page page.

you should listen to backbutton event

// listen to deviceready event
function onDeviceReady() {
  // ..some code here
  document.addEventListener("backbutton", onBackKeyDown, false);
  // ...more code


function onBackKeyDown() {
  // your code here

Hi .I know that and I was using from this code :
function onBackKeyDown() {
var app = new Framework7({});
var page = getCurrentView(app);
if ( == “index”) {
app.dialog.confirm(AppExitMessage, “exit”, exitOk, exitCancel);
} else {;
function exitOk() {
if ( {;
} else if (navigator.device) {
} else {
function exitCancel() {
return false;
But when I click on the back button (android) It hasn’t any reaction.I think I have a problem in how do I have to use from view structure in my application.

But it doesn’t work and I have any reaction after backbutton action.