[TIMOB-28501] Android: MapView within TabGroup crashes as of 10.0.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-07-19T14:04:09.000+0000 |
Affected Version/s | Release 10.0.1 |
Fix Version/s | Release 10.0.1 |
Components | Android |
Labels | TabGroup, android, map, regression |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2021-07-02T01:02:37.000+0000 |
Updated | 2021-07-19T14:04:22.000+0000 |
Description
*Summary:*
Displaying the "ti.map" module's
MapView
within a TabGroup
crashes as of Titanium 10.0.1.
This bug was caught before release.
*Steps to reproduce:*
Build and run the below on Android.
Notice the app crashes on app startup.
const map = require("ti.map");
const tabWindow1 = Ti.UI.createWindow();
tabWindow1.add(map.createView({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
}));
const tabWindow2 = Ti.UI.createWindow();
tabWindow2.add(Ti.UI.createLabel({ text: "Tab 2" }));
const tabWindow3 = Ti.UI.createWindow();
tabWindow3.add(Ti.UI.createLabel({ text: "Tab 3" }));
const tabGroup = Ti.UI.createTabGroup({
tabs: [
Ti.UI.createTab({ title: "Tab 1", window: tabWindow1 }),
Ti.UI.createTab({ title: "Tab 2", window: tabWindow2 }),
Ti.UI.createTab({ title: "Tab 3", window: tabWindow3 }),
],
});
tabGroup.open();
*Cause:*
This issue was caused by the Java TiViewProxy.handleGetView()
method change made by the PR below. The issue is the native tab's parent activity was never set to the actual TabGroup activity.
https://github.com/appcelerator/titanium_mobile/pull/12909/files#diff-c1ca52b23726a03177273b78aed424203d8f5352bf7ba2022f74e2f8ad536ce3
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12932
master and 10_0_X backport merged