Capturing Back Button in Sencha Touch

345 views
Skip to first unread message

Allister

unread,
Sep 9, 2011, 11:18:38 AM9/9/11
to phonegap
Does anyone have any code example of how to do this. I would like to
use the hardware back button to go back in the app rather than it go
to the homescreen as it currently wants to.

It needs to work for Android.

Thanks
Allister

Allister

unread,
Sep 12, 2011, 5:45:58 AM9/12/11
to phonegap
Anyone able to help?

Nimish Nayak

unread,
Sep 13, 2011, 12:08:29 AM9/13/11
to phon...@googlegroups.com
For me in android when i click on back it goes back to the last page i visited .. So if i go google.com then yahoo.com and click on back i end up on google.com. I am using HTC Desire Z

Anyone able to help?
--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

Allister

unread,
Sep 14, 2011, 6:38:47 AM9/14/11
to phonegap
Yes - if the app launches you into a browser webpage, then the back
button takes you either back in the browaer or back into the app. But,
if you stay within the app itself, the back button will take you out
of the app to the device home screen.

I was wanting to capture the back button to go back to the previous
app screen or at least the app splash page.

allister

Nimish Nayak

unread,
Sep 14, 2011, 8:01:03 AM9/14/11
to phon...@googlegroups.com
i think there is a way to do this via PhoneGap API docs 
i dont remember but i had come across it sometime earlier.
:)

Simon MacDonald

unread,
Sep 14, 2011, 9:07:45 AM9/14/11
to phon...@googlegroups.com
Have you tried registering an event listener for the "backbutton"?

http://docs.phonegap.com/phonegap_events_events.md.html#backbutton

Simon Mac Donald
http://hi.im/simonmacdonald

Allister

unread,
Sep 16, 2011, 9:55:53 AM9/16/11
to phonegap
Hi Simon - thanks for the note.

I had found this, but when I tested it, the back button didn't do
anything because I don't have any divs to jump to. I couldn't tell if
the issue was that it just wasn't capturing the back button or the
fact that we are using a completely different architecture (Sencha) as
the code did not produce any errors.

Have you got it to work in sencha and, if so, do you have some example
code?

Thanks
Allister

On Sep 14, 2:07 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Have you tried registering an event listener for the "backbutton"?
>
> http://docs.phonegap.com/phonegap_events_events.md.html#backbutton
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald

Simon MacDonald

unread,
Sep 16, 2011, 10:16:45 AM9/16/11
to phon...@googlegroups.com
No, I haven't used Sencha for anything big yet so I'm not sure what to tell you. Although I'm sure if you register for the backbutton event you would be able to call the proper Sencha code in that event listener to give you your back button functionality.

Simon Mac Donald
http://hi.im/simonmacdonald


Reply all
Reply to author
Forward
0 new messages