showToast
显示消息提示。
方法声明
java
void showToast(SUDOPCommonStateHandle handle, SUDOPShowToastParams params);这是 SUDOPWrappedClient 的宿主回调,通过 registerWrappedClient 注册实现。宿主执行实际操作后,通过 SDK 传入的 handle 返回结果;一次请求只返回一次成功或失败。涉及视图和窗口的操作应在 Android 主线程执行。
SUDOPShowToastParams
| 字段 | 类型 | 说明 |
|---|---|---|
title | String | 提示内容,带图标时也不按字符数截断,应按宽度换行 |
icon | String | success、error、loading、none |
image | String | 自定义图标本地路径,优先于 icon |
duration | int | 显示时长,毫秒 |
mask | boolean | 是否阻止触摸穿透 |
返回结果
成功后调用 handle.success(dataJson);失败时调用 handle.failure(retCode, retMsg),其中 retCode 为非 0 错误码。
成功无需附加数据,可调用 handle.success(null)。
句柄类型:global.sud.op.runtime.client.SUDOPCommonStateHandle。
参数类型位于 global.sud.op.runtime.core.model。
