You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Hi. Yesterday I asked at google groups about thread cancelling in AndroidAnnotations. And Mathieu adviced me to explan this feature in issue.
It' really cool to use @background and @UIView instead of AsyncTask. But not all features of AsyncTask are covered. In our project we have a lot of code, that uses its cancel feature (onCancelled()).
Let me show you couple of most common cases:
Sometimes we run ProgressDialog, while retrieving information from internet, and when user cancels this dialog we want to dismiss it and finish the whole activity. I saw many cases of such behaviour in other apps on GitHub
Sometimes background task should be stopped and runned again with new parameters, that occured somehow.
It would be really useful to have such feature of cancelling background tasks. Don't you think so?
FYI canceling an asynctask doesn't stop the background thread from running, you have to check the cancel status from the background code. You could probably reproduce that kind of behavior with AndroidAnnotations.
The way @Background is designed doesn't allow easy message sending to interrupt. You could use a shared queue as an inbox to get exchange messages between threads.
If you can think of a nice way to cancel @Background task, please let us know and reopen this issue. I'm closing it for now.
Hi. Yesterday I asked at google groups about thread cancelling in AndroidAnnotations. And Mathieu adviced me to explan this feature in issue.
It' really cool to use @background and @UIView instead of AsyncTask. But not all features of AsyncTask are covered. In our project we have a lot of code, that uses its cancel feature (onCancelled()).
Let me show you couple of most common cases:
It would be really useful to have such feature of cancelling background tasks. Don't you think so?