简体   繁体   English

android 活页夹使用 java aidl

[英]android binder using java aidl

In android IPC using binder, when we create an aidl file, build will automatically generate a stub class extending binder and override all the aidl methods right?.在android IPC using binder中,当我们创建一个aidl文件时,build会自动生成一个stub class extending binder并覆盖所有的aidl方法吧?。 In the service class implementation for the aidl methods, have seen instantiating the stub class generated instead of extending the stub class.Since stub class is abstract, how can it be instantiated?在 aidl 方法的服务 class 实现中,已经看到实例化生成的存根 class 而不是扩展存根 class。由于存根 class 是抽象的,如何实例化它?

The question was generic related to interface instantiation.这个问题是与接口实例化相关的一般性问题。 As we know interface can not be instantiated but code like below:正如我们所知,接口不能被实例化,但代码如下:

interface in = new in() {
    public void test(){
        return "ok";
    }
}

is possible as I am defining what the instance need to be done.这是可能的,因为我正在定义需要完成的实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM