In the Android native UI, when I select menu->More->Add-ons, about:addons opens in a new tab in my browser. I then click the back button (physical button on my phone) to return to the page that I was viewing (this is the typical flow from preferences in other Android apps) and the browser exits leaving me back at my home screen. To reproduce: 1. Open any Web page, such as mozilla.org. 2. Select menu button->More->Add-ons. 3. Click the back button. Expected: I am returned to the mozilla.org tab. Actual: Firefox exits.
Created attachment 581433 [details] [diff] [review] WIP This is pretty much complete except I haven't really tested it yet.
Created attachment 581479 [details] [diff] [review] WIP 2
Created attachment 582362 [details] [diff] [review] patch This is not perfect, but I think it's good enough for a first pass. This implements basically the same behavior as XUL Fennec (which in turn is based partly on both Android's stock browser). If you press the system Back button and there is no previous history item in the current tab, then: * If the tab was opened from another activity, Fennec closes the tab and minimizes itself (so you return to the previous activity). * If the tab was opened from another tab (e.g. by selecting "Open link in new tab" from the context menu), Fennec closes the tab and returns to the "parent tab" if that tab is still open. * If the tab was opened within Fennec but has no parent tab, or if the parent tab was closed, then Fennec minimizes itself (and returns to the previous activity). In-content UI like about:firefox and about:addons is always treated as a "child" of the previous tab, so that users can easily dismiss it with the Back button whether or not they noticed that it opened in a new tab.
Verified fixed on: Nightly Fennec 13.0a1 (2012-03-08) Device: HTC Desire Z OS: Android 2.3.3