Default behaviour of the Back button

by Dexter's Brain » Fri, 18 Sep 2009 02:08:17 GMT

Sponsored Links

I am confused, as to what the default behaviour of the back button is,
as far as the Android platform is concerned.

For example, in the Contacts Application, if I am creating a contact,
I just key in a name, and the press back button, the contact is saved
with only the name. Fair enough. But, I then edit this contact to
include a phone number and press back button. This contact is updated
which now includes the phone number. I again edit this contact. This
time I remove the name, as well as the phone number and press the back
button. I get a message saying, "Contact doesn't exist".  In this
case, it deletes the contact. :(

In the mail appllication, while composing, when I press back, it goes
to the drafts folder. Thats good. But, if I just have to cancel this,
and I don't want this to go to drafts folder. For this, I have to open
the menu, and select "Cancel".

Is there any guideline for the back button, as to how should it

Waiting for your comments and suggestions.

Thanks and Regards,

Default behaviour of the Back button

by niko20 » Fri, 18 Sep 2009 04:05:41 GMT


The back button is really not meant to be "cancel" usually, but only
to exit the current screen you are working on.


Sponsored Links

Default behaviour of the Back button

by Dianne Hackborn » Fri, 18 Sep 2009 07:12:57 GMT

 The other key point is that generally our model is for data to be
edit-in-place, so pressing back from something like contacts will close the
screen but retain your edits (since the edits were performed as you did

There will always be exceptions -- I think gmail confirming you want to
cancel your message if you haven't yet saved it as a draft is a good one
because otherwise you unintentionally end up with a lot of drafts -- but
what you see in contacts is the general model.

We do need to get UI guidelines out that describe all of this in much more
detail.  I know this has been an issue for a while.

Btw, the scenario of editing a contact and removing all data then pressing
back is an edge case that to me is consistent with the model -- the contact
has no more data, so it no longer exists.  When you press back you have
already made the edits that make it empty so it is now gone.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Default behaviour of the Back button

by Dexter's Brain » Fri, 18 Sep 2009 18:27:47 GMT

 Thanks for your answers.


Other Threads

1. Seeting the environment for building android source code.

     i am new to android, i want to download and set the source code
in ubuntu 9.10. please help me how to setup the environment and build
tha android application.

Thanks & regards


2. JUnit warning: Test class not found in selected project

I found this post here:

3. When will Android 2.2 source code release

4. Recording a .WAV file

5. issues with Camera Preview in Emulator

6. Gathering.

7. ItemizedOverlay.hitTest incorrect