Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26865] Android: Activity "onRestart" callback no longer invoked as of 8.0.0.RC

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2019-03-04T10:19:10.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.0
Componentsn/a
Labelsactivity, android, callback, qe-testadded, regression, restart
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-02-27T01:06:06.000+0000
Updated2019-04-30T22:40:52.000+0000

Description

*Summary:* As of Titanium 8.0.0.RC, the Activity callback assigned to [onRestart](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Activity-property-onRestart) is no longer invoked. This is a regression. The "onRestart" callback is supposed to be invoked after the activity's "onStop" to indicate that the activity window is being resumed from the background. *Steps to reproduce:*

Build and run the below code on Android.

Wait for the app to appear onscreen

Press the "Home" button to suspend the app.

Resume the app.

Observe the log and notice that "onRestart" was not logged.

var window = Ti.UI.createWindow();
window.add(Ti.UI.createLabel({ text: "Activity onRestart Test" }));
window.activity.onRestart = function() {
	Ti.API.info("@@@ Activity.onRestart() called.");
	Ti.UI.createNotification({
		message: "Activity.onRestart() called.",
		duration: Ti.UI.NOTIFICATION_DURATION_SHORT,
	}).show();
};
window.open();

Comments

  1. Joshua Quick 2019-02-28

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10733 PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10734
  2. Lokesh Choudhary 2019-02-28

    FR Passed for both PR's. Waiting for Jenkins to allow to merge.
  3. Lokesh Choudhary 2019-03-01

    PR's Merged.
  4. Samir Mohammed 2019-03-04

    Closing ticket, fix verified in SDK Version 8.1.0.v20190301155716 and SDK Version 8.0.0.v20190301145350. Test and other information can be found at: PR (master): https://github.com/appcelerator/titanium_mobile/pull/10733 PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10734

JSON Source