- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I want to track hardware back button event on my app for android. If user press hardware back button from device I want to track this event.
I had tried these below function already but its not working anymore.
document.addEventListener("intel.xdk.device.ready",function() {
//start grabbing the Android hardware back button
intel.xdk.device.addVirtualPage();
},false);
document.addEventListener("intel.xdk.device.hardware.back", function() {
//continue to grab the back button
intel.xdk.device.addVirtualPage();
document.getElementsByTagName("body")[0].innerHTML += "Hardware back button pressed
";
}, false);
Currently my app is based on appframework 3.
Anyone has idea how to do it right way?
Thank you!
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recommend using the Apache Cordova "backbutton" event instead for tracking when the user presses the Android back button. You can find information at https://cordova.apache.org/docs/en/dev/cordova/events/events.backbutton.html. Currently, the intel.xdk apis are not being maintained for current mobile platform versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Until now I still can not make a back button. Does anyone know? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ariska - Adding a back button differs for different templates. Do you just want to create a back button by hand, or are you using a particular template? If you want backbuttons on a tab view, for example, take a look at the Yoga sample. In the Yoga sample app look at the bottom of the index.html file. The back buttons are enabled when you don't use the clearhistory() function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the same problem. But when I change theme into device native, or android - light or ios it works. Only when I use App Framework theme backbutton close the app.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page