[TIMOB-26975] Android: LiveView does not reload app if "Don't keep activities" is enabled as of 8.0.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-04-29T14:23:22.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.1 |
Components | Android |
Labels | LiveView, android, engSchedule, regression |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-04-10T00:56:38.000+0000 |
Updated | 2019-04-29T14:23:22.000+0000 |
Description
*Summary:*
If Android "Developer Options" setting "Don't keep activities" is enabled, then JavaScripts edits made while LiveView is running won't restart the app as of Titanium 8.0.0.
*Steps to reproduce:*
Go to the Android device's main "Settings" screen.
Tap on "System" under "Settings.
Tap on "Developer options" under "System" settings.
Enable "Don't keep activities", which should be near the bottom of the list.
Build and run the below code on the above Android device.
Edit the "app.js" file and save your changes.
Notice that the app does not restart. The below log message does not get logged agin.
Ti.API.info("### The 'app.js' file was loaded.");
var window = Ti.UI.createWindow();
window.open();
*Cause:*
The TiApplication.softRestart()
method attempts to fetch the root activity first before doing the restart. The fetched root activity will be null
in this case, because the "Don't keep activities" option will destroy when showing a child activity. This is the edge case that is not handled.
[TiApplication.java#L741](https://github.com/appcelerator/titanium_mobile/blob/864d8f10b30b5d4fabb4d235a44e715973750c5a/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L741)
*Work-Around:*
Disable the "Don't keep activities" option.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829
PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868
FR passed PR merged.
*Closing ticket*, fix verified in SDK version
8.0.1.v20190426162041
and SDK version8.1.0.v20190426222341
Test and other information can be found at: Master : https://github.com/appcelerator/titanium_mobile/pull/10829 8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10868