从远程服务运行活动 [英] Running activity from remote service
问题描述
IAM试图从我的远程服务运行不同势包活动: 这是我如何实现service.java
iam trying to run an activity from diffrent package from my remote service: this is how i implement the service.java
public class CurrencyService extends Service
{
public class CurrencyServiceImpl extends ICurrencyService.Stub
{
int CALL_PUSH_SERVICE_ACTIVITY=10;
@Override
public void callSomeActivity(int activityId) throws RemoteException
{
Intent pushActivity=new Intent("com.pushservice.PushActivity");
pushActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(pushActivity);
}
.....
}
香港专业教育学院还增加了服务的清单一行:
ive also added a line in the manifest of the service:
服务工作正常,但我不能跑活动 - > PushActivity这是在不同势包装不同势的应用, 这是错误:
the service works fine, but i cant run the activity -> PushActivity which is in diffrent package of diffrent application, this is the error:
活动未发现异常:无活动处理意向{行为= com.pushservice.PushServiceActivity FLQ = 0×10 ......
Activity not found Exception: No Activity found to handle Intent {act=com.pushservice.PushServiceActivity flq=0x10 ...
感谢。
推荐答案
您正试图打开一个活动
有一个意图过滤器
与动作
>com.pushservice.PushActivity。你没有一个活动
有一个意图过滤器
与动作$ C $的c>
com.pushservice.PushActivity
。
You are attempting to open an Activity
that has an intent-filter
with an action
of "com.pushservice.PushActivity"
. You do not have an Activity
that has an intent-filter
with an action
of "com.pushservice.PushActivity"
.
最好的答案是不显示从服务活动,因为用户会很恼火你,如果你打断他们时,他们正在使用的设备。
The best answer is to not display an activity from a service, since users will be very irritated with you if you interrupt them when they are using the device.
这篇关于从远程服务运行活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!