{ "id": "63876", "key": "TIMOB-3244", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11247", "name": "Sprint 2011-12", "archived": true, "released": true, "releaseDate": "2011-03-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-04T16:28:46.000+0000", "created": "2011-04-15T03:40:17.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "honeycomb", "release-1.7.0", "reported-1.6.0" ], "versions": [], "issuelinks": [ { "id": "10242", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "64772", "key": "TIMOB-3702", "fields": { "summary": "Confirm TIMOB-3244", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-05-04T16:28:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

app.js fail case:

\n
\nTitanium.UI.setBackgroundColor('#000');\nvar tabGroup = Titanium.UI.createTabGroup();\nvar win1 = Titanium.UI.createWindow({  \n    title:'Tab 1',\n    backgroundColor:'#fff'\n});\nvar tab1 = Titanium.UI.createTab({  \n    title:'Tab 1',\n    window:win1\n});\n\ntabGroup.addTab(tab1);  \ntabGroup.open();\n
\n

Fail trace:

\n
\nE/AndroidRuntime(  420): FATAL EXCEPTION: main\nE/AndroidRuntime(  420): android.content.res.Resources$NotFoundException: Resource ID #0x0\nE/AndroidRuntime(  420):    at android.content.res.Resources.getValue(Resources.java:1014)\nE/AndroidRuntime(  420):    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2039)\nE/AndroidRuntime(  420):    at android.content.res.Resources.getLayout(Resources.java:853)\nE/AndroidRuntime(  420):    at android.view.LayoutInflater.inflate(LayoutInflater.java:389)\nE/AndroidRuntime(  420):    at android.widget.TabHost$LabelIndicatorStrategy.createIndicatorView(TabHost.java:534)\nE/AndroidRuntime(  420):    at android.widget.TabHost.addTab(TabHost.java:226)\nE/AndroidRuntime(  420):    at ti.modules.titanium.ui.widget.TiUITabGroup.addTab(TiUITabGroup.java:91)\nE/AndroidRuntime(  420):    at ti.modules.titanium.ui.TabGroupProxy.addTabToGroup(TabGroupProxy.java:183)\n
{html}", "attachment": [], "flagged": false, "summary": "Android: tabbed applications fail (crash) in honeycomb", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "130364", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Here's some native code you can play with that mimics how we\ncreate tabs:

\n

HelloTabWidget.java

\n
\npackage com.billdawson.android.hellotabwidget;\n\nimport android.app.ActivityGroup;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.widget.FrameLayout;\nimport android.widget.TabHost;\nimport android.widget.TabWidget;\n\npublic class HelloTabWidget extends ActivityGroup {\n    /** Called when the activity is first created. */\n    @Override\n    public void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        TabHost tabHost = new TabHost(this);  // The activity TabHost\n        tabHost.setId(android.R.id.tabhost);\n        TabWidget tabWidget = new TabWidget(this);\n        tabWidget.setId(android.R.id.tabs);\n        FrameLayout tabContent = new FrameLayout(this);\n        tabContent.setId(android.R.id.tabcontent);\n        tabHost.addView(tabWidget);\n        tabHost.addView(tabContent);\n        tabHost.setup(getLocalActivityManager());\n        TabHost.TabSpec spec;  // Resusable TabSpec for each tab\n        Intent intent;  // Reusable Intent for each tab\n\n        // Create an Intent to launch an Activity for the tab (to be reused)\n        intent = new Intent().setClass(this, ArtistsActivity.class);\n        // Initialize a TabSpec for each tab and add it to the TabHost\n        spec = tabHost.newTabSpec(\"artists\").setIndicator(\"Artists\")\n                      .setContent(intent);\n        tabHost.addTab(spec);\n        setContentView(tabHost);\n    }\n}\n
\n

ArtistsActivity.java

\n
\npackage com.billdawson.android.hellotabwidget;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.TextView;\n\npublic class ArtistsActivity extends Activity\n{\n\n    @Override\n    public void onCreate(Bundle savedInstanceState)\n    {\n        super.onCreate(savedInstanceState);\n        TextView textview = new TextView(this);\n        textview.setText(\"This be the Artists tab\");\n        setContentView(textview);\n    }\n    \n}\n
\n

This native example creates the TabHost using\nnew TabHost(...) like we do in our TiUITabGroup.java.\nIt works fine in api 10 and lower, but not in api 11 (Honeycomb).\nIf you alter the native code above (HelloTabWidget.java) so that\nHelloTabWidget extends TabActivity\ninstead of ActivityGroup, then replace TabHost\ntabHost = new TabHost(this); with TabHost tabHost =\ngetTabHost();, it will work fine in Honeycomb.

\n

I don't think we'll be able to solve this until we can see\nHoneycomb source code and see how the updated\nTabActivity creates its TabHost so we can\ndo something similar. Some resource is missing, apparently. Maybe\nwe need to do a .setId(...) on something.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:40:17.000+0000", "updated": "2011-04-15T03:40:17.000+0000" }, { "id": "130365", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Adding release-1.7.0 tag. May need to port back to 1.6.1. If we\ndo then we'll add that tag then.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:40:17.000+0000", "updated": "2011-04-15T03:40:17.000+0000" }, { "id": "130366", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

\nhttps://github.com/appcelerator/titanium_mobile/commit/19728696a23a...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:40:18.000+0000", "updated": "2011-04-15T03:40:18.000+0000" }, { "id": "130367", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [19728696a23a8f9d45e044ead3b39162c68706fb])\nChange TiTabActivity to inherit from TabActivity so as to use\nTabHost in the manner expected by android (TabActivity.getTabHost()\nrather than new TabHost()). This enables our default apps (the\ntwo-tab app that gets created when you create a new titanium\nproject) to run on Honeycomb. [#3244]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/19728696a23a...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:40:18.000+0000", "updated": "2011-04-15T03:40:18.000+0000" }, { "id": "133206", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on Xoom.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-04T16:28:46.000+0000", "updated": "2011-05-04T16:28:46.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }