The phone maintains a history stack of the cards a user visits, enabling the user to navigate backward through the cards by pressing PREV. Each time the user navigates forward to a card, the phone pushes the card onto the history stack. Each time the user presses PREV to navigate backward, the phone pops the current card off the stack, leaving the previous card at the top of the stack.
The UP.Phone history model differs slightly from the model used by most WWW browsers. Most WWW browsers provide Back and Forward commands that allow you to navigate backward and forward through the history. On a UP.Phone, the current card is always at the top of the history. You can only navigate backward through the history.
For example, suppose an email service provides sequential cards to enter an email message address, subject, and body. After entering the address and the subject, the user can back up to either card by pressing PREV. Figure 1-5 illustrates this interface. The HDML for the cards is shown on the left; the state of the history stack at each point in the navigation is shown on the right.
When the user presses the Home key on the phone, the phone displays the user's home card. This trims (prunes) the history stack, so that the home card is the only card in the stack. If you override the default action for the PREV key, it also prunes the history stack to the current card.