运行活动
问题描述:
IAM试图从我的远程服务来运行,从不同势包活动: 我这是怎么实现的service.java运行活动
}
香港专业教育学院还增加了行该服务的清单:
该服务工作正常,但我无法运行活动 - > PushActivity这是在diffrent应用程序的不同包, 这是错误:
活动未发现异常:无活动处理意向{行动= com.pushservice.PushServiceActivity FLQ = 0x10的 ...
感谢。
答
您正在尝试打开一个Activity
,其intent-filter
与action
的"com.pushservice.PushActivity"
。您没有Activity
,它的intent-filter
与action
的"com.pushservice.PushActivity"
。
最好的答案是不显示来自服务的活动,因为如果您在使用设备时中断用户,您将非常恼火。
答
您不应该从您的服务调用开始活动。从Android developers best practice:
Instead of spawning Activity UIs directly from the background, you should instead use the NotificationManager to set Notifications. These will appear in the status bar, and the user can then click on them at his leisure, to see what your application has to show him.
是的,但我有这个活动的关注,是不是可以达到任何GUI,这将中断用户,但只是做别的事情的背景,但只是在后台工作(有没有屏幕那将显示出来)..我要如何调整我的清单才能运行它? – Moshik 2010-04-29 14:08:19
你不能有一个活动“只是为了在后台做别的事情,但只是为了在后台工作(没有屏幕显示)”。这是服务的目的。 – CommonsWare 2010-04-29 14:49:25
Okie,这样生病把它放在哪里,你将如何从远程服务调用,到另一个远程服务来做另一个工作..我想要一个模块化系统,每个远程服务将负责系统的某个部分。 – Moshik 2010-04-29 17:59:21