If the user performs a search during update I want to wait until the update ends while "Wait" is displayed, a warning about readiness. I do not want to query and display search results until the update is fully completed.
This is your call, but remember that you are creating your own problem. Personally, I would drop this requirement. The user should not be uncomfortable just because the alarm went out.
For example, you can turn off the alarm and turn it on again when activity disappears.
Or, so that the update is performed in such a way that it is atomic (for example, doing the update on a copy of the table and then synchronizing the tables in the transaction) so that the activity can safely access the database while the update is taking place.
What would be the βrightβ way to wait (maybe even with update status) in this case?
Notify the service when the update is in progress, through some kind of callback, or possibly an Intent broadcast. Keep a progress indicator until this happens. This still introduces some troubles of the time, so I just give up this requirement.
source share