Problem with Android When Press Back Button on FirstPage

Thread is closed for posting
2 posts, 0 answers
  1. Yılmaz
    Yılmaz avatar
    3 posts
    Member since:
    May 2015

    Posted 16 Sep 2015 Link to this post


     I am developing an app with Kendo Mobile js library and AppBuilder Windows Client.

    My problem is in my application when I press Back button on FirstPage it raises an exception instead of quitting app "Uncaught ReferenceError: start is not defined" , I am sharing my example code, I am trying it with Andy (emulator), Samsung Note 3 (Android 4.3 ) and Genymotion (Android 4.4.4), and behaves same on each environment.

     I can not find how to archive my project in appbuilder.

    Kendo UI Core v2015.2.813



    <!DOCTYPE html>
        <meta charset="utf-8" />
        <link href="kendo/styles/" rel="stylesheet" />
        <script src="cordova.js"></script>
        <script src="kendo/js/jquery.min.js"></script>
        <script src="kendo/js/"></script>
        <script src="app.js"></script>
            <div data-role="layout" data-id="main" >
                <div data-role="header">
                    <div data-role="navbar">
                        <span data-role="view-title"></span>
                        <button data-role="backbutton" data-align="left" data-click-on="down" >Back</button>
                <!-- application views will be rendered here -->


    <div data-role="view" data-title="Main Page" data-layout="main"  data-transition="overlay"  >
        First Page
        <button data-role="button" onclick="app.mobileApp.navigate('second.html');">Second Page</button>

    app .js

    var app = {
    document.addEventListener('deviceready', function () { 
            // hide the splash screen as soon as the app is ready. otherwise
            // Cordova will wait 5 very long seconds to do it for you.
            app.mobileApp = new, {
                                                             // comment out the following line to get a UI which matches the look
                                                             // and feel of the operating system
                                                             skin: 'flat',
                                                             // the application needs to know which view to load first
                                                             initial: 'main.html',
        window.onerror = function(msg, url, line, col, error) {
            // Note that col & error are new to the HTML 5 spec and may not be
            // supported in every browser.  It worked for me in Chrome.
            var extra = !col ? '' : '\ncolumn: ' + col;
            extra += !error ? '' : '\nerror: ' + error;
            // You can view the information in an alert to see things working like this:
            alert("Error: " + msg + "\nurl: " + url + "\nline: " + line + extra);
            // TODO: Report this error via ajax so you can keep track
            //       of what pages have JS issues
            var suppressErrorAlert = true;
            // If you return true, then error alerts (like in older versions of
            // Internet Explorer) will be suppressed.
            return suppressErrorAlert;



    <div data-role="view" data-title="Second Page" data-layout="main"  data-transition="overlay"  >
        Welcome to second Page!


  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 18 Sep 2015 Link to this post

    Hi Yilmaz,

    You can exit the application invoking
    For example:

    <button data-role="button" data-align="left" onclick="">Back 1</button>

    You can also write a more complicated logic in a function to serve the requirement you have.
    <button data-role="button" data-align="left" onclick="onButtonDown()">Back 2</button>

    // Handle the button
    function onButtonDown() {
        // Exit the app!

    You can also check the following resources: 
    Android back button forum;
    Exit Mobile App in PhoneGap post;

    As a side note, in regard to archiving a solution, please check the topic on Export  Your Project.
    I hope this helps.


    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top