I have the following situation:
I have a Service that periodically checks for new data over the Internet,
- When new data is available, it is loaded and stored in sqlite.
- When the save to db is complete, the service passes the intent so that the activity knows in order to pull new data from the db.
User can request an immediate update ...
... in this case, I use Messenger to query the Services to search for new data.
Here is the problem:
the user is notified that the request continues, but it may take some time, it may be unsuccessful, it will never be able to return ...
I am currently receiving a message (using Messenger) back from the Service to Activity, informing the result of the request, or, if I do not receive the message, after x seconds I inform the user that the request was unsuccessful.
- Please can you suggest a different approach?
- I do not like to wait for a message, and if after x seconds no one is received, tell the user if there is a better way?
java android
Lisa anne
source share