Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27481] Android: Navigating back from camera overlay can wrongly close the app

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2020-10-22T22:23:38.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
Labelsandroid, back, camera, engSchedule, overlay
ReporterYordan Banev
AssigneeJoshua Quick
Created2019-10-17T14:33:55.000+0000
Updated2020-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.

Comments

  1. Joshua Quick 2020-10-01

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12143
  2. Sohail Saddique 2020-10-08

    FR Passed for this ticket.
  3. Lokesh Choudhary 2020-10-22

    Verified the fix with SDK 9.3.0.v20201022111908. Closing.

JSON Source