Android的远程服务 [英] Android Remote Services
本文介绍了Android的远程服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找的远程机器人服务commonwares例子。我一直在logcat中获得这个错误
I was looking at the commonwares example on remote android services. I keep getting this errors in logcat
10-22 19:50:33.947: E/AndroidRuntime(30624): FATAL EXCEPTION: main
10-22 19:50:33.947: E/AndroidRuntime(30624): java.lang.SecurityException: Binder invocation to an incorrect interface
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.os.Parcel.readException(Parcel.java:1322)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.os.Parcel.readException(Parcel.java:1276)
10-22 19:50:33.947: E/AndroidRuntime(30624): at com.commonsware.android.advservice.client.IScript$Stub$Proxy.executeScript(IScript.java:82)
10-22 19:50:33.947: E/AndroidRuntime(30624): at com.commonsware.android.advservice.client.RemoteClientNewActivity$2.onClick(RemoteClientNewActivity.java:59)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.view.View.performClick(View.java:2532)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.view.View$PerformClick.run(View.java:9277)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.os.Handler.handleCallback(Handler.java:587)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.os.Handler.dispatchMessage(Handler.java:92)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.os.Looper.loop(Looper.java:143)
10-22 19:50:33.947: E/AndroidRuntime(30624): at android.app.ActivityThread.main(ActivityThread.java:4196)
10-22 19:50:33.947: E/AndroidRuntime(30624): at java.lang.reflect.Method.invokeNative(Native Method)
10-22 19:50:33.947: E/AndroidRuntime(30624): at java.lang.reflect.Method.invoke(Method.java:507)
10-22 19:50:33.947: E/AndroidRuntime(30624): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
我一直在努力,现在解决了一段时间。
I have been trying to resolve it for a while now.
在活动这是我做的。
Intent i = new Intent("com.commonsware.android.advservice.IScript");
bindService(i,svcConn, Context.BIND_AUTO_CREATE);
和
public void onServiceConnected(ComponentName className,IBinder binder) {
service=IScript.Stub.asInterface(binder);
if(service !=null){
message = "connected";
}
}
请谁能告诉我什么,我做错了。
Please can anyone tell me what I am doing wrong.
推荐答案
在我而言,我是因为我有这个服务安装在我的设备上的另一个变种得到这个错误,当我删除它,一切都很好。
In my case, I got this error because I had another variant of this service installed on my device, once I removed it, everything was good.
这篇关于Android的远程服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文