jjzjj

spiceManager

全部标签

android - android.os.Service 上下文中的 Robospice

根据RoboSpice文档https://github.com/octo-online/robospice/wiki/Design-of-RoboSpice,我可以在任何上下文中使用它。找不到在服务上下文中使用Robospice的示例。我做了一些尝试,但什么也没发生,请求只是不执行,没有异常(可能是一些日志泄漏,我需要做什么才能在设备上启用robospice日志?)从哪里开始/停止?(spiceManager.start(this)/spiceManager.shouldStop())在哪里创建SpiceManager实例?(我的服务在application.onCreate()方法中

android - 我可以在服务中使用 SpiceManager 吗?

我正在尝试将SpiceManager附加到服务,但我得到:java.lang.ClassCastException:android.os.BinderProxycannotbecasttocom.octo.android.robospice.SpiceService$SpiceServiceBinderatcom.octo.android.robospice.SpiceManager$SpiceServiceConnection.onServiceConnected(SpiceManager.java:1072)atandroid.app.LoadedApk$ServiceDispat