user675319
user675319

Reputation: 71

Android Design guidelines, "Cancel" button

I have a question about "dialogs" on Android.

¿It's necessary a "cancel" button on dialogs, or we assume that user will press the "back" buton to dismiss it?

I know it's a personal choice, but I'd like to know if there is any guideline from google or Android in this case.

There is some information about it in this link: UI design - Include a Cancel button or not?

but this is "windows", and I'm asking in Android (that should be different, I believe!)

Upvotes: 0

Views: 2074

Answers (4)

kabuko
kabuko

Reputation: 36302

While I don't remember any specific guidance, I think there's a lot of implicit evidence to say yes you should use a cancel button in dialogs. If you look at the Android Design site, you'll see examples of it. It's also mentioned in the documentation on Dialogs:

However, note that dialogs can also be "cancelled." This is a special case that indicates the dialog was explicitly cancelled by the user. This will occur if the user presses the "back" button to close the dialog, or if the dialog explicitly calls cancel() (perhaps from a "Cancel" button in the dialog). When a dialog is cancelled, the OnDismissListener will still be notified, but if you'd like to be informed that the dialog was explicitly cancelled (and not dismissed normally), then you should register an DialogInterface.OnCancelListener with setOnCancelListener().

If your dialog is purely informative then I don't think it's necessary, but if there's any behavior difference between pressing your positive button (e.g. OK) and cancelling then I believe you should have an explicit cancel button.

Upvotes: 2

Ravi Vyas
Ravi Vyas

Reputation: 12375

You should add the Cancel button.

Imagine you are making an ICS app which would ship to tablets , the Back button is way too far to the left for a person to click when holding the tablet with one hand.

There is also some sort of context to the dialog when you provide a cancel button. Usually dialogs with one buttons means there is not option the user has. When you have both the "Ok" & "Cancel" button it provides a hint to the user that he/she has a choice.

An error dialog usually has one button : "OK" and lets the user know there is not much he can use.

A network available dialog has two buttons : "Ok" & "Cancel" letting the user know he may or may not join the network.

In fact as mentioned in the answer in the question you linked , you should do both to have better support.

Upvotes: 2

Arpit Patel
Arpit Patel

Reputation: 1571

Its depend on what you are going to provide the information on the dialog. If there would be an exit dialog you will need the cancel button and if there would not be any requirement of the cancel button then only one button ok that will display the information.when that button is pressed then it will back on the last activity...

Upvotes: 1

Darren Kopp
Darren Kopp

Reputation: 77667

It really depends on the context. Should you in fact be saving on back button? Sometimes yes, sometimes no. Try all the permutations and see which you like best (A/B testing)

Edit: Just saw it was dialog box. I would say yes, unless you are crunched for space. It's more specific and easier to understand I think.

Upvotes: 1

Related Questions