提交 1264b485 编写于 作者: Z zhangbirong

modify WindowExtensionAbility onConnect function

Signed-off-by: Nzhangbirong <zhangbirong@huawei.com>
Change-Id: I05b7fc2fb9b16352fcc71ea144d753608b2aa60b
上级 4fc94f66
......@@ -25,7 +25,7 @@ import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
## WindowExtensionAbility.onConnect
onConnect(want: Want): rpc.RemoteObject
onConnect(want: Want): void
当窗口扩展组件第一次连接ability时回调。
......@@ -35,46 +35,13 @@ onConnect(want: Want): rpc.RemoteObject
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 当前ability的Want类型信息,包括ability名称、bundle名称等。 |
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------- | -------------------- |
| [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | 窗口功能的代理对象。 |
**示例:**
```ts
import rpc from '@ohos.rpc';
class StubTest extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
return true;
}
queryLocalInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
sendRequest(code, data, reply, options) {
return null;
}
getCallingPid() {
return 1;
}
getCallingUid() {
return 1;
}
attachLocalInterface(localInterface, descriptor){}
}
export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onConnect(want): rpc.RemoteObject {
onConnect(want) {
console.info('WindowExtAbility onConnect ' + want.abilityName);
return new StubTest("test");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册