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
[TIMOB-25886] Refactor Ti.App._restart() #9946
Conversation
Generated by 🚫 dangerJS |
566b3a3
to
d878797
Compare
runtime.initRuntime(); | ||
|
||
// manually re-launch app | ||
runtime.doRunModule(KrollAssetHelper.readAsset(APP_PATH), APP_PATH, getActivityProxy()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our TiLaunchActivity.loadActivityScript()
and the resolveUrl()
method it calls does some extra logic when loading a JavaScript on startup. Particularly with Alloy. We might need to do a code shift.
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiLaunchActivity.java#L120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I'll test these changes with an Alloy app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update, works fine with Alloy apps
KrollRuntime runtime = KrollRuntime.getInstance(); | ||
|
||
// prevent termination of root activity via TiBaseActivity.shouldFinishRootActivity() | ||
TiBaseActivity.canFinishRoot = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we set canFinishRoot
to false
, then backing out of the first Ti.UI.Window in a restarted window will now show the launcher activity, right? We may need to reset canFinishRoot
back to true
after the restart.
Perhaps this shouldn't be an exposed public global and handle it via a method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canFinishRoot
returns to true on Line 229
@jquick-axway ping |
NOTES
Need to test with native Titanium modulesWorksTEST CASE
JIRA Ticket