0

I'm developing an application that should support:

  • Devices without the action bar (< Android 3.0)
  • Devices with an action bar

Now, my hierarchy allows the user to go down one level, for example:

  • Home Screen
    • Submenu 1
    • Submenu 2
    • Submenu 3 (launches WebView)

In the Web View, the Back button is overloaded for web navigation, so I need a separate Home button)

With Android 3.0 and above, I can easily use the application's icon as a Home button, provided I've declared the android:parentActivityName in the Manifest. This will make the Home button appear as "Back", and will provide a way go to the home screen even when you're deep in some web view hierarchy.

However, with devices below 3.0, there is no action bar, and therefore no Home button. The question now is: By the default design guidelines, how should I allow the user to go back to my home screen immediately?

The Android navigation guidelines don't mention anything related to this for versions below 3.0. I was thinking about adding a classical menu item (which would appear when the menu button is pressed), but then I'd have to make this unavailable for any device that has an action bar. Is this the way to go?

slhck
  • 36,575
  • 28
  • 148
  • 201
  • Use the Flag new task and Clear top tp start your home activity from any screen – njzk2 Feb 04 '13 at 10:24
  • 2
    Not an answer so i'll just comment, but having devices under Android 3.0 is no reason not to use the actionbar. You can use the compatibility library from Google to back-port a perfectly fine ActionBar, or more easily use ActionbarSherlock library – Stefan de Bruijn Feb 04 '13 at 10:24
  • (see http://stackoverflow.com/questions/5794506/android-clear-the-back-stack ) – njzk2 Feb 04 '13 at 10:24
  • @njzk2 I know that I can do so, but this is not related to my question. I'm asking for the design principle to use, i.e. where and how to allow the user to go back home. – slhck Feb 04 '13 at 10:28
  • @StefandeBruijn I didn't say I wouldn't use the action bar at all. I do use it for devices ≥3.0. I'll look into ActionBarSherlock, but this seems overkill for what I'm doing. Thanks though. – slhck Feb 04 '13 at 10:29
  • you're asking for design principles, while ignoring the biggest one Google makes: Implement an Actionbar. There are no sub-set of design guidelines you have to do, after ignoring one of the most important ones. ActionBarSherlock isn't much of an overkill really, you just extend your Activity with SherlockActivity instead and set a few setters if you want to change standard behavior. Shouldn't take much more then 10 minutes to implement a basic Actionbar – Stefan de Bruijn Feb 04 '13 at 11:31
  • @StefandeBruijn Fair enough – but how has this been handled before the ActionBar even existed? – slhck Feb 04 '13 at 11:34
  • Not sure, but i guess you would just be forced to use the back-button until the webview can't go back any further and then you get back to controlling the activities with it. Just another good reason for the Actionbar ;) – Stefan de Bruijn Feb 04 '13 at 12:41
  • you mean in terms of UI ? – njzk2 Feb 04 '13 at 12:59
  • @njzk2 Yes – for example if I should simply add a menu item for going back home. – slhck Feb 04 '13 at 13:21

0 Answers0