[TIMOB-28376] Android: Update header and footer view activity
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-03-11T14:49:10.000+0000 |
Affected Version/s | Release 9.3.2, Release 10.1.0, Release 10.0.0 |
Fix Version/s | Release 10.0.0 |
Components | Android |
Labels | android, crash, fragments, mapview |
Reporter | Hans Knöchel |
Assignee | Gary Mathews |
Created | 2021-03-07T13:05:21.000+0000 |
Updated | 2021-03-11T14:49:10.000+0000 |
Description
The following code crashes the app on Android, while it works fine on iOS:
const window = Ti.UI.createWindow();
const mapView = Ti.UI.createView({ height: 200 });
mapView.add(require('ti.map').createView());
const listView = Ti.UI.createListView({
headerView: mapView, // This throws the error - works fine on iOS
sections: [
Ti.UI.createListSection({
items: [ { title: 'Test 1' }, { title: 'Test 2' }, { title: 'Test 3' } ]
})
]
})
window.add(listView);
window.open();
The crash / stacktrace is:
[ERROR] E/com.example.app Invalid ID 0x00000002.
[DEBUG] AndroidRuntime: Shutting down VM
[ERROR] TiExceptionHandler: (main) [1539,1753] No view found for id 0x2 (unknown) for fragment SupportMapFragment{b743c3e} (b6132652-63cc-4547-83f3-18d882add40a) id=0x2}
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:315)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
[ERROR] TiExceptionHandler: androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861)
[ERROR] TiExceptionHandler: androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
[ERROR] TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:938)
[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:223)
[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7656)
[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
It's a blocker we currently cannot workaround, so it'd be great to have some feedback on it - maybe then we can fix it ourselves. Thank you!
Attachments
File | Date | Size |
---|---|---|
ListViewHeaderViewTest.js | 2021-03-09T23:47:32.000+0000 | 768 |
TableViewHeaderLabelTest.js | 2021-03-09T23:46:48.000+0000 | 845 |
PR (by Sergey): https://github.com/appcelerator/titanium_mobile/pull/12524
This bug also prevented the headerView/footerView from updating after a dark/light theme change. So, we'll need this fixed for 10.0.0 since that SDK version adds official dark/light theme support. Thanks for bringing this up [~hknoechel]!
FR Passed, waiting on Jenkins build and backports.
Squash merged to master, manually cherry-picked to 10_0_X for 10.0.0 target