【问题标题】:Start service on installation of app without any activity在没有任何活动的情况下安装应用程序时启动服务
【发布时间】:2013-05-27 06:03:53
【问题描述】:

是否可以在没有任何活动的情况下直接启动服务。通过使服务成为启动器。我想以 2 分钟的间隔重复启动服务。我可以用闹钟吗? 目前我有一个使用这个启动警报的活动 manager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), 持续时间, loggerIntent); 每 2 分钟启动一次服务。如何删除此活动。

【问题讨论】:

  • 2.3版以后就不行了

标签: android


【解决方案1】:

没有直接的方法来启动服务,只需安装应用程序,而无需用户第一次打开它。如果您阅读了上述两个问题的答案,您将了解要点。
1)How to start a Service when .apk is Installed for the first time

2)How to start android service on installation

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 2015-03-07
    • 2012-06-10
    • 2016-06-27
    • 1970-01-01
    • 2015-11-17
    • 1970-01-01
    • 2017-01-25
    • 2019-02-24
    • 1970-01-01
    相关资源
    最近更新 更多