Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19919

Android: add ability to listen to androidback without overriding

    Details

    • Story Points:
      3
    • Sprint:
      2016 Sprint 2 SDK, 2016 Sprint 13 SDK

      Description

      Currently it is possible to override the default behavior for the back button. But you can't really use this for enhancing this functionality or just listen to the back button event without overriding it.

      There is no way to call super.onBackPressed() from on the windows activity from JavaScript side.

      I think it would make sense to add another property to the Ti.UI.Window that lets you explicitly override this behavior. I'd prefer this:

      var win = Ti.UI.createWindow();
       
      win.onBack = function(){
        // explicitly override back button behavior
      };
       
      win.addEventListener('androidback', function(){
        // just listen for the event without influencing the default behavior
      });
      

      Does that make sense?

      The reason why I need this is that I'm trying to create a proper navigation history. As there are no more lightweight windows, I want to implement a kind of backstack for Views or Fragments.

        Attachments

          Activity

            People

            • Assignee:
              msamah Ashraf Abu (Inactive)
              Reporter:
              manuellehner Manuel Lehner
            • Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code