Results 1 to 4 of 4

Thread: Native android sencha touch app and support for back button

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    1

    Default Native android sencha touch app and support for back button

    I am making an app that I would like to deploy to android and ios using the native packageing that is in sencha touch. The problems is that androids dedicated back-button does not seem to supported by sencha touchs native android apps, and using it simply exits the app. This behavior is unacceptable on android.
    So my question is if sencha touch 2.3 which is currently in beta will support androids dedicated back button in the native app? And if so, how?
    I am aware that using phonegap will make this possible, but I would prefer to do it just using sencha touchs native app.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    I'd use Phonegap if you need to listen to the back button.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3

    Default

    Please could you tell us in the phoneGap? Same problem with me.

  4. #4
    Sencha User Pulp Fiction's Avatar
    Join Date
    Mar 2013
    Location
    Italy
    Posts
    80
    Answers
    2

    Default

    Hi, this is the correct way to manage the physical back button on Android device:

    http://docs.phonegap.com/en/3.3.0/co...tml#backbutton

    I'm using Phonegap 3.3.0 with ST 2.3.0. This is what I recommend.

    This is an example of onLoad function:

    Code:
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
        
        function onDeviceReady() {
            document.addEventListener("backbutton", onBackKeyDown, false);
        }
        
        function onBackKeyDown() {
            Ext.Viewport.setActiveItem(0);
        }
    }
    Don't forget to include all the procedures for the components of Cordova/PhoneGap.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •