handling back button android

02-28-2017 03:54 AM
New Contributor III

i found the code below:

focus: true // important - otherwise we'll get no key events         Keys.onReleased: {               if (event.key === Qt.Key_Back) {                     event.accepted = true                    //do some action here like close or pop the stack view               }            }

Where should i put this to make it work???
0 Kudos
1 Reply
Esri Contributor

It depends. If you app is simple and only has one main page then you just need to add it in one place. If your page uses Stack view and multiple pages(views) then you need to add this in each page since back might mean close or back for that particular page functionality.

Check the code in Quick Report 1.3 template based app and you will find how its being handled.

0 Kudos