Status Update
Comments
gg...@google.com <gg...@google.com>
gg...@google.com <gg...@google.com> #2
Can you provide the below requested information to better understand the issue:
Can you please test with latest library and update result here.
https://developer.android.com/topic/libraries/support-library/revisions.html
If possible please provide a complete sample application.
Expected output
What do you expect to occur?
Current output
What do you see instead?
Can you please test with latest library and update result here.
If possible please provide a complete sample application.
Expected output
What do you expect to occur?
Current output
What do you see instead?
ha...@gmail.com <ha...@gmail.com> #3
This seems to be intended according to https://issuetracker.google.com/74278849 , the suggestion is to remove the extra logic to deliverResult() in onStartLoading().
ne...@sonymobile.com <ne...@sonymobile.com> #4
@gg..@google.com
Sample project is attached.
Steps to test:
1. Import, build and install apk
2. Notice "Number of 'onLoadFinished' calls: 1"
3. Click "Click me!" button to start Second Activity
4. Notice "Number of 'onLoadFinished' calls: 2"
EXPECTED: At stap 4 "Number of 'onLoadFinished' calls" should be 1.
ACTUAL: It's 2.
@ha...@gmail.com
That's not the solution because developers are not in control of all Loaders. For example CursorLoader from support libaray should be then fixed by google, not by developers.
And this is behavior change which is not documented, so suggestion on issuetracker is not good enough.
Sample project is attached.
Steps to test:
1. Import, build and install apk
2. Notice "Number of 'onLoadFinished' calls: 1"
3. Click "Click me!" button to start Second Activity
4. Notice "Number of 'onLoadFinished' calls: 2"
EXPECTED: At stap 4 "Number of 'onLoadFinished' calls" should be 1.
ACTUAL: It's 2.
@ha...@gmail.com
That's not the solution because developers are not in control of all Loaders. For example CursorLoader from support libaray should be then fixed by google, not by developers.
And this is behavior change which is not documented, so suggestion on issuetracker is not good enough.
gg...@google.com <gg...@google.com> #5
We have shared this with our engineering team and will update this issue with more information as it becomes available.
sp...@gmail.com <sp...@gmail.com> #6
Do you have any news ?
lb...@gmail.com <lb...@gmail.com> #7
@6 I think they changed the way it works, without much information about the change.
Try this solution I've written about (read the last part of the text too, as it talks about the changes) :
https://stackoverflow.com/a/22675607/878126
Try this solution I've written about (read the last part of the text too, as it talks about the changes) :
sp...@gmail.com <sp...@gmail.com> #8
@7 Thank you for your information. I still get the error when orientation change
lb...@gmail.com <lb...@gmail.com> #9
@8 I can't confirm. It works fine without any error .
Attached sample project, that "loads" content, and after 5 seconds returns a result, that will be returned on the current Activity.
Attached sample project, that "loads" content, and after 5 seconds returns a result, that will be returned on the current Activity.
sp...@gmail.com <sp...@gmail.com> #10
OK I'll check it again. Thx a lot!
sp...@gmail.com <sp...@gmail.com> #11
@9 Hello man, when orientation change the "onLoaderFinished" method, called again. Do you know how to stop calling this method?
lb...@gmail.com <lb...@gmail.com> #12
@11 It is called only once after onCreate is called, just as intended.
The reason is that after you load something, you wish to use it. After orientation change, all is destroyed, but the result is still available, so you can use it.
If you don't want to use the result, either ignore it, or check whether the loader (if existing) has a result or not.
But this loses the whole point of using a loader. By using a loader, you are supposed to use its result, even after an orientation change.
The reason is that after you load something, you wish to use it. After orientation change, all is destroyed, but the result is still available, so you can use it.
If you don't want to use the result, either ignore it, or check whether the loader (if existing) has a result or not.
But this loses the whole point of using a loader. By using a loader, you are supposed to use its result, even after an orientation change.
Description
Version used: 27.1.0
Theme used: N/A
Devices/Android versions reproduced on: N/A
Test cast:
1. Have Activity1 with Loader (check sample code)
2. Open different activity (switch app or open another activity in app)
3. Return to Activity1
4. Observer Logcat or put breakpoint in 'onLoadFinished'
EXPECTED: 'onLoadFinished' is NOT called after returning to Activity1 if data is already delivered before.
ACTUAL: 'onLoadFinished' IS called.
Sample code:
Use sample code and observe Logcat.