Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback 无法使用 #2

Closed
gzplace opened this issue Aug 20, 2018 · 1 comment
Closed

callback 无法使用 #2

gzplace opened this issue Aug 20, 2018 · 1 comment
Labels

Comments

@gzplace
Copy link

gzplace commented Aug 20, 2018

我按照 sample 中的方式 在service端 编写了相应的接口
类似:
@RemoteInterface
public interface ITestCallback {
void onTestFired();
}

并且在 App端 调用 linker.registerObject(mTestCallback)
mTestCallBack 为本地实现接口
但在 service 中无法获取此接口,故无法反调此callback,或许使用有误,还请告知正确步骤,谢谢!

@codezjx
Copy link
Owner

codezjx commented Aug 22, 2018

@gzplaceService端暴露的远程接口IRemoteService 中,需要提供注册Callback的方法呀~ 这样Client端就可以通过registerCallback方法把Callback跨进程传到Service端了呀,然后就能回调啦~ 在READMESample里面都相关的代码和描述,建议再仔细阅读一次哦~

@RemoteInterface
public interface IRemoteService {
    ...
    void registerCallback(@Callback ITestCallback callback);
    ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants