how to keep an Intent service running

后端 未结 3 1286
忘了有多久
忘了有多久 2020-12-30 10:58

I have two examples of Intentservice. One is the Download example in the commonsware book. the other is at http://www.vogella.com/articles/AndroidServices/article.html#ser

3条回答
  •  一整个雨季
    2020-12-30 11:32

    How do I keep it running?

    You don't. IntentService is designed to do a piece of work (or perhaps a few off a queue, if commands happen to come in rapidly), then shut down.

    The service I am writing has to have events and listen for things.

    Then you should not be using an IntentService. Use a regular Service, with your own background thread(s) as needed.

提交回复
热议问题