Conversation
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
Warning Message: "'OnLifecycleEvent' is deprecated. Deprecated in Java" Replacing 'LifecycleObserver' with 'DefaultLifecycleObserver' and then using this interface's functions via a public override instead of decorating a function with the '@OnLifecycleEvent' annotation is now the recommended and more explicit way forward. PS: The previous annotation based solution required the usage of code generation or reflection, which should be avoided. For more info see: - androidx.lifecycle.OnLifecycleEvent (Documentation): https://developer.android.com/reference/androidx/lifecycle/ OnLifecycleEvent - androidx.lifecycle.DefaultLifecycleObserver (Documentation): https://developer.android.com/reference/androidx/lifecycle/ DefaultLifecycleObserver
16 tasks
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | Jetpack | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | b60be53 | |
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | WordPress | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | b60be53 | |
42 tasks
Contributor
Author
|
Thank you for reviewing and testing this PR @zwarm , you rock! 🙇 ❤️ 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Parent: #17173
Partially Closes: #17181
This PR resolves all
LifecycleEventrelatedDeprecatedwarnings for theWordPressmodule:Classes:
PS: @zwarm I added you as the main reviewer, that is, in addition to @wordpress-mobile/apps-infrastructure team itself, but randomly, since I want someone from the
WordPress Androidteam to primarily sign-off on that change. 🥇FYI: I am going to randomly add more of you in those PRs that will follow, just so you become more aware of this change and how close we are on enabling
allWarningsAsErrorsby default everywhere. 🎉To test:
WordPressandJetpackapps, and see if their lifecycle observer related functionalities are working as expected. In more details, and per class, you could test the following (using the debugger or adding extra logs):[onStop]: Put the app in background and verify that theonStop(...)function is called.[onStart]Pull the app from background and verify that theonStart(...)function is called.[onStart]: Pull the app from background and verify that theonStart(...)function is called.[onDestroy]: Enter thePostsscreen, then exit thePostsscreen and verify that theonDestroy(...)function is called.[onDestroy]: Enter thePostsscreen, then exit thePostsscreen and verify that theonDestroy(...)function is called.[onDestroy]: Trigger a newPostcreation, then go back and verify that theonDestroy(...)function is called.[onCreate]: Swipe-off the app and kill it, then open the app and verify theonCreate(...)function is called.[onDestroy]: I am not sure how to verify that theonDestroy(...)function is also called, but verifying theonCreate(...)should be enough anyway. PS: From the comment within this function you will notice that the author wasn't sure about that too.Regression Notes
The lifecycle observer related functionalities are not working as expected, thus causing problems with various background related functionalities of the app (see the
To testsection above to understand more about that via testing).See
To testsection above.PR submission checklist:
RELEASE-NOTES.txtif necessary.