Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24255] Android: Different behaviours on device back button when open EmailDialog by Gmail app

GitHub Issuen/a
TypeStory
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-12-11T22:46:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterShuo Liang
AssigneeUnknown
Created2016-12-22T01:02:34.000+0000
Updated2018-12-11T22:46:38.000+0000

Description

Reproduce.

1. Run a simple app like following on different Android Device
var win = Ti.UI.createWindow({
	backgroundColor:"white"
});

var button = Ti.UI.createButton({
	title: "Send Email",
	top: 100,
	left: 100
});

button.addEventListener("click", function(){
	EmailDialog();
});
win.add(button);

win.open();

function EmailDialog() {
	var emailDialog = Ti.UI.createEmailDialog();
	emailDialog.subject = "Hello from Titanium";
	emailDialog.toRecipients = ['foo@yahoo.com'];
	emailDialog.messageBody = '<b>Appcelerator Titanium Rocks!</b>';
	var f = Ti.Filesystem.getFile('Answers.pdf');
	emailDialog.addAttachment(f);
	emailDialog.open();
}
2. Click the button, Then choose Gmail to open EmailDialog 3. Touch the device back button on the bottom.

Problem

1. On Samsung S4 with Android 5.0.1, the device back button will close Gmail app, and go back to our original app. This is what customer expected. 2. But On Samsung S5 snd S6 with Android Lollipop and Marshmallow, the device back button will close all app include our original app.

Comments

  1. Gary Mathews 2016-12-27

    [~sliang] Maybe this could help?
       var win = Ti.UI.createWindow({
       	backgroundColor: 'white',
       	exitOnClose: false
       });
       

JSON Source