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): Refactored activity/fragment restore handling #10829
Conversation
- [TIMOB-26966] Fixed bug where back navigating from child window causes app to exit when "Don't keep activities" is enabled as of 7.2.1. - [TIMOB-26914] Fixed 8.0.0 regression where an OS forced quit app displays a blank window upon relaunch. (Was incorrectly restoring child activity.) - [TIMOB-17089] Resolved view ID conflicts causes app crashes when activity/fragment is restored. - [TIMOB-26964] Fixed bug where TabGroup would be blank (no tabs) when calling child window's close() method while "Don't keep activities" is enabled. - [TIMOB-26890] Fixed bug where tapping 3rd tab in TabGroup can cause a crash due to view ID conflict during fragment restore. - Increased TabGroup's ViewPager offscreen page limit from 1 to 128 to avoid tab fragment from being destroyed/restored. - Added several safety mechanisms to AlertDialog and ProgressIndicator dialog code to avoid crashes.
Tests:
|
…hin a fragment such as "ti.map" view - Re-added ID assigned to TiUIFragment's view, but it's now guaranteed to be assigned a unique ID.
…f "Don't keep activities" is enabled as of 8.0.0
- [TIMOB-15829] Fixed crash caused by progress indicator set to status bar that happens after hiding twice and then opening.
@jquick-axway TabGroup changes look good to me! |
|
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.
LGTM, just a minor comment above.
Since onBackPressed
has been refactored, QE should also run tests from these tickets again just to be safe:
https://jira.appcelerator.org/browse/TIMOB-24531
https://jira.appcelerator.org/browse/TIMOB-23969
https://jira.appcelerator.org/browse/TIMOB-23989
@@ -1726,6 +1684,22 @@ protected boolean shouldFinishRootActivity() | |||
return TiBaseActivity.canFinishRoot && isIntentRequestingFinishRoot; | |||
} | |||
|
|||
@Override | |||
public void finishAfterTransition() |
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.
Is this override necessary, does't finishAfterTransition
call finish
?
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.
The override is needed to call the removeFromActivityStack(this)
like we do in the finish()
method... because I removed the method call from the WindowProxy
class. Now all of the addToActivityStack()
and removeFromActivityStack()
calls are done in the same place, the TiBaseActivity
class. The old code wants to remove the activity from the stack (before the onDestroy()
happens) so that the next child Ti.UI.Window
that the code might open won't use its context.
@jquick-axway , For https://jira.appcelerator.org/browse/TIMOB-24531. All of the other tests seem to be fine. |
@jquick-axway To address the issue @lokeshchdhry found, should we change the direction we terminate the activity stack? Terminate the child activities before the current? |
- [TIMOB-26966] Fixed bug where Window/TabGroup close()method call is ignored until "open" event has been fired. * Resolved by modifying proxy's handleClose() to call TiActivityWindows.remove() immediately. - Fixed bug where dynamically changing "exitOnClose" would be ignored. * Flag was only being read by activity's "launchIntent" in 8.0.0. * Now reads directly from proxy, which is the best solution. Especially if onNewIntent() was called. (Old code would have had a problem too.) - Re-added support for "exitOnClose" in child windows. (Was only supported by root window.) - Removed window exit animation if its "exitOnClose" was set true. (Prevents parent window briefly appearing upon exit.) - Added more dialog safe-guards. * Would crash if failed to create dialog builder if there are no activities available. * Can happen if "Don't keep activities" is enabled, you press the Home button, and code attempts to show dialog in the background.
Updated PR. @garymathews, I resolved the issue @lokeshchdhry found in |
@jquick-axway Please could you look at the merge conflict? |
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.
CR: PASS
FR Passed. The activity/fragment refactor looks good. Studio Ver: 5.1.2.201903111843 |
JIRA:
Summary:
AlertDialog
andProgressIndicator
dialog code to avoid crashes when activity is destroyed, but not finished. (Can happen when "Don't keep activities" is enabled.)TableView
with aSearchBar
orSearchView
attached to it. (Proxies should not be released unless activity is finished.)close()
method call was ignored until "open" event was fired.Test Restore After OS Force Quit:
Test Intent ACTION_VIEW with "Don't keep activities":
Test TabGroup with "Don't keep activities":
Test LiveView Restarts with "Don't keep activities":
Ti.API.info()
message is logged again.