我有一点疑惑,
看来我的服务不打印日志,
服务会定期启动(我可以调试它),我会看到所有其他日志,
但是从服务中没有日志。
请在这里我想念什么?
@Override
protected void onHandleIntent(Intent intent) {
Log.e("TAG","Downlaoding devices list");//This should log something!
可能是您的IntentService没有被调用。尝试使用IntentService的整个程序包名称。我在某处看到过此消息,如果找到它,我会发布一个链接。像这样
Intent intent = new Intent(this/*Context*/,com.myapp.MyIntentService.class); //as opposed to // new Intent(this, MyIntentService.class); startService(intent);
编辑:我找到了链接。intentService:为什么从未调用过我的onHandleIntent?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句