提交 f153944e 编写于 作者: H Hollokin

修改示例代码使用了废弃接口的问题

Signed-off-by: NHollokin <taoyuxin2@huawei.com>
上级 040b8e44
...@@ -126,14 +126,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback&lt;boolea ...@@ -126,14 +126,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback&lt;boolea
**示例:** **示例:**
```js ```js
let im = inputMethod.getCurrentInputMethod(); let prop = inputMethod.getCurrentInputMethod();
let prop = {
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
try{ try{
inputMethod.switchInputMethod(prop, (err, result) => { inputMethod.switchInputMethod(prop, (err, result) => {
if (err) { if (err) {
...@@ -183,14 +176,7 @@ switchInputMethod(target: InputMethodProperty): Promise&lt;boolean&gt; ...@@ -183,14 +176,7 @@ switchInputMethod(target: InputMethodProperty): Promise&lt;boolean&gt;
**示例:** **示例:**
```js ```js
let im = inputMethod.getCurrentInputMethod(); let prop = inputMethod.getCurrentInputMethod();
let prop = {
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
try { try {
inputMethod.switchInputMethod(prop).then((result) => { inputMethod.switchInputMethod(prop).then((result) => {
if (result) { if (result) {
...@@ -2138,11 +2124,8 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: Async ...@@ -2138,11 +2124,8 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: Async
```js ```js
let inputMethodProperty = { let inputMethodProperty = {
packageName: 'com.example.kikakeyboard',
methodId: 'com.example.kikakeyboard',
name: 'com.example.kikakeyboard', name: 'com.example.kikakeyboard',
id: 'com.example.kikakeyboard', id: 'com.example.kikakeyboard',
extra:{}
} }
try { try {
inputMethodSetting.listInputMethodSubtype(inputMethodProperty, (err,data) => { inputMethodSetting.listInputMethodSubtype(inputMethodProperty, (err,data) => {
...@@ -2190,11 +2173,8 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise&lt;Arr ...@@ -2190,11 +2173,8 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise&lt;Arr
```js ```js
let inputMethodProperty = { let inputMethodProperty = {
packageName: 'com.example.kikakeyboard',
methodId: 'com.example.kikakeyboard',
name: 'com.example.kikakeyboard', name: 'com.example.kikakeyboard',
id: 'com.example.kikakeyboard', id: 'com.example.kikakeyboard',
extra:{}
} }
try { try {
inputMethodSetting.listInputMethodSubtype(inputMethodProperty).then((data) => { inputMethodSetting.listInputMethodSubtype(inputMethodProperty).then((data) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册