Question

I have a question regarding the concept of contextual action bar. The Android Design Guide suggests to use the CAB when the user selects something in an Activity to offer him some actions.

As implemented in the "People"(/"Contacts"?) application, it also makes sense to edit data. For example, I want the user to click a list item which brings him to a details activity. In the details activity you can press on an edit action item that brings you to the edit activity. In this edit activity I want to show the CAB to allow saving by pressing the DONE button or BACK button or cancel via a menu item.

Is the CAB intended to be used in this way? It´s implemented in the People app like this, so I think yes.

My current implementation starts the action mode on activity creation. This is somehow uncool, because when pressing DONE, I start an AsyncTask to save the data on the server, which needs time, but the CAB is gone immediatelly and then the default action bar is shown. Is there a nicer way to use the CAB, so that it gets destroyed not before the activity?

PS: using ActionBarSherlock

Was it helpful?

Solution

Is the CAB intended to be used in this way? It´s implemented in the People app like this, so I think yes.

That's not necessarily an action mode. In Roman Nurik's "DONE + DISCARD" sample, it is a custom action bar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top