[TIMOB-11796] Android: ActionBar not getting set on Tab windows
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-15T22:45:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.0.2, Release 3.1.0, 2012 Sprint 26 Core, 2012 Sprint 26 |
Components | Android |
Labels | module_actionbar, qe-automation, qe-port, triage |
Reporter | Arthur Evans |
Assignee | Allen Yeung |
Created | 2012-11-15T23:58:31.000+0000 |
Updated | 2014-08-15T22:45:20.000+0000 |
Description
It appears that the action bar is not getting added to the window activity when you create a tab group. For example, this code works if
win
is a standard window:
win.addEventListener('open', function() {
var actionBar = win.activity.actionBar;
actionBar.title = 'TITANIUM APP';
});
However, if win
is a tab window, it fails because actionBar is undefined.
This ticket is either related to, or a duplicate of, TIMOB-11766 I filed my bug because the TabGroup is actually a Window under the covers, and the tabs' "windows" are actually views. Following that logic, I found TabGroup.activity.actionBar
this is, indeed, a subset of your bug. Why don't you relate it too to TIMOB-11601?
Shannon, I'm not able to duplicate you results on TabGroup.activity.actionBar. Running against both 3.0.X and master, when I try to access TabGroup.activity, it's undefined. I tried waiting for the tab group open event or the window open event, no go. What code are you using to access that tab group's activity? And what build are you running against?
NM. I figured out that TabGroup.getActivity() was working, but it wasn't properly exposed as a property, so TabGroup.activity was showing up as undefined. So, if you use getActivity(), you can access the action bar _and_ set action items. If you use window.activity on a tab group, you can only set action items. A little weird. At a minimum, we should expose TabGroup.activity.
Test case:
1. Run the code above 2. Look at logcat and you should see the success message
PR: https://github.com/appcelerator/titanium_mobile/pull/3520
Following this issue, it's a really annoying one.
Environment used for verification - Titanium SDK: 3.1.0.v20130114171802 Titanium Studio:3.0.1.201212181159 Device: Samsung GALAXY Note (2.3.6)
Reopening to edit fixVersion