Status Update
Comments
pa...@gmail.com <pa...@gmail.com> #2
As a general note, what you're checking makes little sense - onAttachFragment
is called as fragments move through their lifecycle methods (specifically, right after onAttach()
is called on the fragment) and is therefore likely to be called while FragmentTransactions are being processed - if you have multiple commit()
s in flight, the state you get back in onAttachFragment
will certainly not be the final state the FragmentManager will be when all of the FragmentTransactions are executed, making this a bit of a meaningless check.
That being said, this is caused by the mechanism used to kick off transitions when reordering is not allowed, which is being reworked in
As a workaround, you can use setReorderingAllowed(true)
on your transaction, which will allow your example project to work correctly.
pa...@gmail.com <pa...@gmail.com> #3
This has been fixed internally and will be avilable in Fragment 1.3.0-alpha08.
Note: this fix relies on using the
pm...@google.com <pm...@google.com> #4
This gives you information about the status of your work (Blocked, Enqueued, Cancelled, etc).
To get information about the status of the task you're doing inside a worker (like, as you wrote, getting the progress for a file update) you should handle this information yourself between the worker and the UI.
WorkManager only provides support to pass information from the worker when the task is complete through the Result.succes(data) or Result.failure(data) calls.
pa...@gmail.com <pa...@gmail.com> #5
But I think will be better if progress report is supported natively by WorkManager.
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: n/a
Will be very usefull to be possible to report a progress from the Worker to the UI.
For instance, to show the user the progress of the upload of a file,
Thanks and keep the good work.