Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26975] Android: LiveView does not reload app if "Don't keep activities" is enabled as of 8.0.0

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-04-29T14:23:22.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.1
ComponentsAndroid
LabelsLiveView, android, engSchedule, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-04-10T00:56:38.000+0000
Updated2019-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.

Comments

  1. Joshua Quick 2019-04-12

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829
  2. Joshua Quick 2019-04-26

    PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868
  3. Lokesh Choudhary 2019-04-26

    FR passed PR merged.
  4. Samir Mohammed 2019-04-29

    *Closing ticket*, fix verified in SDK version 8.0.1.v20190426162041 and SDK version 8.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

JSON Source