Handle back button via code javascript [phone 8.1]

Get help using Construct 2

Post » Sat Aug 02, 2014 11:14 am

Hey, since plugin to handle back button doesn't work while exporting as universal app i want to do it manually (in code) but dunno how, because didn't even write anything in JS.
Could someone help me? I just want close app when it is on start screen, and go to start screen when it is on any other layout. (Now app goes to suspended mode when press back on any layout)
Where should i start?
Probably base.js file.
I Found this code and im prety sure that i have to handle it here:
Code: Select all
        backclick: [
            function Application_backClickHandler(e, handled) {
                if (handled) {
                    e._winRTBackPressedEvent.handled = true;
                } else if (WinJS.Navigation.canGoBack) {
                    WinJS.Navigation.back();
                    e._winRTBackPressedEvent.handled = true;
                }
            }
        ],


i can post whole code if needed.
B
3
Posts: 2
Reputation: 175

Post » Sat Aug 02, 2014 11:17 am

If you use the browser object's back button, then it should work just fine. I have only tested it on Windows 8.1 phone universal app.
B
44
S
5
G
5
Posts: 412
Reputation: 5,771

Post » Sat Aug 02, 2014 11:38 am

How I could miss that. Thank you so much. Its working
B
3
Posts: 2
Reputation: 175


Return to How do I....?

Who is online

Users browsing this forum: kalibark2, ST314 and 28 guests