簡體   English   中英

將數據從活動發送到Intentservice

[英]sending data from activity to Intentservice

我的需求是將數據從活動發送到IntentService

(從擴展活動的類到擴展IntentService的類)

我成功通過使用BroadcastReciver發送到示例服務,但我想擴展IntentService類而不是服務

有人知道我該怎么辦?

公共類MainActivity擴展Activity {...}

公共類MyIntentService擴展了IntentService {...}

將數據放入與startService()調用一起使用的Intent extra中以啟動IntentService 然后, IntentService可以在onHandleIntent()讀取額外的onHandleIntent()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM