Zahhar Kirillov
Posts: 0
Joined: Thu Jul 25, 2013 9:41 am

Backbutton event binds globally to the app, not to the single screen

Another problem with 'Backbutton' events that seems like a bug. Please advise.

I have a screen named X with 'Backbutton' event, that openes a popup screen. I can navigate through my app and press hardware Back button on my Andreoid device with normal behaviour on all other screens, until I visit screen X. On screen X when hardware Back button is pressed, event is fired correctly and I see a popup.

After that something crashes, and app starts showing popup every time hardware Back button is pressed on any other screen. Feels like Backbutton event is global now. Is it a problem of my own app architecture, or a wider problem?

Thank you!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Backbutton event binds globally to the app, not to the single screen

Hello!

We'll reproduce the issue and let you know as soon as possible.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Backbutton event binds globally to the app, not to the single screen

What Android version do you have?

Zahhar Kirillov
Posts: 0
Joined: Thu Jul 25, 2013 9:41 am

Backbutton event binds globally to the app, not to the single screen

I run Android 2.3.3 (Overcome Kratos build 3.1) on my Samsung Galaxy Tab 7" P1000 device. Tomorrow I ill have access to several modern Androids and can report if problem persists.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Backbutton event binds globally to the app, not to the single screen

Zahhar,

We couldn't reproduce it on Nexus7 4.2.2.
Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a, tell us its name and what exactly we should do to reproduce the issue.

Zahhar Kirillov
Posts: 0
Joined: Thu Jul 25, 2013 9:41 am

Backbutton event binds globally to the app, not to the single screen

Thanks, Katya!

My app is shared with you, named MBACard.

Steps to reproduce:

  1. Run the app with Appery.io.Tester

  2. On the first screen tap "Show Card" button in the footer. Next screen with card image and timer will be opened.

  3. Press hardware "Back" button on your device and you will see a popup displayed, with slider and OK button on it.

  4. Tap "OK" button - popup disappears, and you will be transfered back to the main screen.

  5. Now click hardware "Back" again: you still have a popup displayed! You migh also navigate through the app and press "Back" from other screens, and you will face popup all the time.

    I appreciate your help on this issue!

    Zahhar

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Backbutton event binds globally to the app, not to the single screen

Hello! This is how it suppose to work. Ones you define event on backbutton on device ready event on current screen the following code is added:
code$(document).unbind('backbutton').bind({
"backbutton": function() {
//here is your code
}/code
that means this event has been defined for entire document. If you don't need this event triggered on other screens, but just on one of them (let's say ScreenX) then on other screens except ScreenX (I mean not all of them, only screens where you might navigate from ScreenX) on device ready event add the following code:
code$(document).unbind('backbutton');/code

Zahhar Kirillov
Posts: 0
Joined: Thu Jul 25, 2013 9:41 am

Backbutton event binds globally to the app, not to the single screen

Thank you, Marina!

Should I also do
code$(window).unbind('orientationchange');/code

if I bind it on my ScreenX to execute one JS function only when that particular ScreeX changes orientation? All other screens have default behaviour.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Backbutton event binds globally to the app, not to the single screen

Hi Zahhar -- jQuery Mobile API documentation should help:
:: http://api.jquerymobile.com/orientati...

Return to “Issues”