Hi
Android 4 (ICS) offers an element of the type ActionBar. Using an ActionBar, I created a search widget in which I can enter text to trigger a remote search. If you click on the magnifying glass icon in this ActionBar to open the text field of the search widget, two things will happen:
- The on-screen keyboard is displayed.
- The home button (application icon in the upper left corner) changes its functionality of the up button. "up" means that you undo your last action (in this case: opening the text field of the search widget)
If you press the up button, the search widget will crash to make the text box disappear. At the same time, the up button changes its functionality to act as a home button. This behavior describes the default behavior of an Android 4 ActionBar with an attached search widget.
Using the hardware back button instead of the soft up button, the keyboard disappears, but the search widget remains open. Also, the up button does not change to the home button.
My question is: How can I launch the up button in an ActionBar software application? If I could do this, I could collapse the text field of the search widget and return the up button to become the home button again if the user clicks the back button of the equipment.
This example displays the home button on the left and the closed search widget "magnifier icon" on the right. If the user clicks on the magnifying glass, a text box appears and the "home" button becomes the "up" button.
Thanks in advance!

source share