[TIMOB-27481] Android: Navigating back from camera overlay can wrongly close the app
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2020-10-22T22:23:38.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 9.3.0 |
| Components | Android |
| Labels | android, back, camera, engSchedule, overlay |
| Reporter | Yordan Banev |
| Assignee | Joshua Quick |
| Created | 2019-10-17T14:33:55.000+0000 |
| Updated | 2020-10-22T22:23:38.000+0000 |
Description
When a Camera activity with an overlay is opened from the first window in an application and the system's back button is pressed the application gets closed.
*Test code:*
_app.js_
var win = Ti.UI.createWindow(),
button = Ti.UI.createButton({ title: 'Camera' });
button.addEventListener('click', function () {
Ti.Media.showCamera({
overlay: getOverlay()
});
});
win.add(button);
win.open();
function getOverlay() {
var view = Ti.UI.createView({
backgroundColor: '#55990000',
});
return view;
}
Opening a camera activity from another window and clicking back works as expected - only the camera activity is closed.
One reason this may happen is that the camera activity with an overlay does not have a WindowProxy child and this raises the exitOnClose flag when we go back from it with only one window in the stack.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12143
FR Passed for this ticket.
Verified the fix with SDK 9.3.0.v20201022111908. Closing.