Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to properly (and consistently) trap android back tap?

$
0
0

This has been asked several times ALLLLL across the Interwebs, but I'm looking for a definitive answer (since nothing seems to be working).

I'm using the following code to try to detect (and then trap) the android back tap, but the code is not throwing at all.

var backtrap = Ti.UI.currentWindow;
backtrap.addEventListener('android:back' , function(e){
    Ti.API.info('android:back trapped back button');
    return false;
});
backtrap.addEventListener('androidback' , function(e){
    Ti.API.info('androidback trapped back button');
    return false;
});
Any ideas?

Thanks in advance!

App Type: Android Mobile TiVer: 4.0.0.x on Windows Device: moto e


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>