Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android)(7_5_X): Restored pre-7.5.0 behavior where "app.js" should be re-executed when launched via data intent while backgrounded #10678

Merged
merged 1 commit into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/Resources/ti.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,15 @@ require('./ti.internal/extensions/Error');
require('./ti.internal/bootstrap.loader').loadAsync(function () {
// We've finished loading/executing all bootstrap scripts.
// We can now proceed to run the main "app.js" script.
if (Ti.Android) {
// On Android, Titanium 7.5.x can launch another UI stack for the same JS runtime via an intent.
// The require() function has already cached "app.js" in this case. We must re-execute it explicitly.
// Note: Below is not needed as of 8.0.0 since intents in that version will resume existing UI instead.
if (global.Module.cache['/app.js']) {
var scriptText = Ti.Filesystem.getFile('app.js').read().text;
global.kroll.binding('evals').Script.runInThisContext(scriptText, '/app.js', true);
return;
}
}
require('./app');
});