Re: [問題] Service在開機時啟動

看板AndroidDev作者 (黑炭)時間11年前 (2013/06/06 17:03), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《milochen (N=NP)》之銘言: : Sorry, I cannot type Chinese now. : But, here I can start Service easily here : Actually, It's just need to understand INTENT : And there are just three step if you want to start Service at booting : Step 1. In AndroidManifest.xml, add Intent filter for BOOT_COMPLETED : example. : ----------------------------------------- : <application ...> : <service ... > : <intent-filter> : <action android:name="android.intent.action.BOOT_COMPLETED" /> : </intent-filter> : </service> : </application> : ------------------------------------- 樓上這篇對我沒用... 找了四個小時找到另外一個解決方法 不是在<service>裡面加 <intent-filter> 而是開一個BroadcastReceiver 詳情.. http://stackoverflow.com/questions/4562734/android-starting-service-at-boot-time 縮網址 http://ppt.cc/geyH -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.166.46.224

06/06 23:10, , 1F
確實該篇是錯誤的 不過居然是兩年前的文章.
06/06 23:10, 1F
文章代碼(AID): #1Hi51eZC (AndroidDev)
討論串 (同標題文章)
文章代碼(AID): #1Hi51eZC (AndroidDev)