开发者

Android Restart a Service

开发者 https://www.devze.com 2022-12-28 01:41 出处:网络
I have the following question: I start my activity and i call bindService in order to start a service which in background downloads data from an API.

I have the following question:

I start my activity and i call bindService in order to start a service which in background downloads data from an API. When it finish, it calls stopSelf().

But if i want to call again bindService in my开发者_开发百科 Activity in order to download other data, nothing happens.

Any idea?


If it's just a one off download that you're doing, wouldn't using AsyncTask be more appropriate?

http://developer.android.com/reference/android/os/AsyncTask.html

0

精彩评论

暂无评论...
验证码 换一张
取 消