Skip to content Skip to sidebar Skip to footer

Why Use A Android Service?

Im wondering what is the point of using a android service to do background work when you need to do a lot of things just to access any public methods or get a large chunk of data f

Solution 1:

Nitpick: an object running a threaded background task ain't precisely what's usually meant by a plain old Java object.

If you don't care what happens to the work being done if its requesting Activity or Application is shut down, then by all means avoid services. One of the main points of Services is that they can stay alive when the user navigates away from an Activity: if you're only doing work to fill a UI ListView, by all means use e.g. an AsyncTask, as is discussed in this earlier question.

Post a Comment for "Why Use A Android Service?"