Project: titanium
Issue TIMOB-19919: Android: add ability to listen to androidback without overriding
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: {code:javascript} 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 }); {code} 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.
Story points: 3