-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dropping view moved from onDestroy to onPause
- Loading branch information
Konstantin Mikheev
committed
Jul 5, 2016
1 parent
7f41b8f
commit 9c0e10c
Showing
9 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Apr 10 15:27:10 PDT 2013 | ||
#Tue Jul 05 22:25:10 CEST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9c0e10c
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.
why don't you presenterDelegate.onDropView() in onStop instead? Because View is actually drop after onStop.
9c0e10c
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.
onStart is called before activity state restoration.
This can lead to some data loss when you need to return it from presenter and then state restored and wipes fresh data.
onStop is also not guaranteed, AFAIK.
9c0e10c
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.
Thanks for your reply.
I agree with you. It works almost cases.
But how about this case:
first activity starts a blur activity, so 1st activity goes onPause, not onStop. But we still want to update 1st activity's UI. How can we do it?
https://developer.android.com/training/basics/activity-lifecycle/pausing.html
9c0e10c
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.
Did we already get a real-time blurring algorithm? :)
I think it is safe to stick with the classical onPause way. It was quire reliable, I never had any complains about it. Official Android docs also recommend to pause ongoing actions and unsubscribe from messages.
If you need a special lifecycle, you could use NucleusView which does not depend on onPause/Stop logic at all. Or just create your own view, this is very simple, just copy-paste it and change whatever you need!