Trying to start a service on boot on Android

后端 未结 16 1465
慢半拍i
慢半拍i 2020-11-21 06:41

I\'ve been trying to start a service when a device boots up on android, but I cannot get it to work. I\'ve looked at a number of links online but none of the code works. Am

16条回答
  •  走了就别回头了
    2020-11-21 07:05

    I have an additional -tag, don't know if that makes any difference.

      
              
                  
                  
              
    
    

    Have you tried ommiting the if-clause "android.intent.action.BOOT_COMPLETED".equals(intent.getAction(), as the receiver probably only receives that intent anyway?

提交回复
热议问题