showActionSheet
显示操作菜单,并返回用户选择。
方法声明
java
void showActionSheet(SUDOPCommonStateHandle handle, SUDOPShowActionSheetParams params);这是 SUDOPWrappedClient 的宿主回调,通过 registerWrappedClient 注册实现。宿主执行实际操作后,通过 SDK 传入的 handle 返回结果;一次请求只返回一次成功或失败。涉及视图和窗口的操作应在 Android 主线程执行。
SUDOPShowActionSheetParams
| 字段 | 类型 | 说明 |
|---|---|---|
alertText | String | 警示文案 |
itemList | List<String> | 按钮文字,最多 6 项 |
itemColor | String | 按钮文字颜色 |
返回结果
成功后调用 handle.success(dataJson);失败时调用 handle.failure(retCode, retMsg),其中 retCode 为非 0 错误码。
json
{"tapIndex":0}tapIndex 从 0 开始。用户取消时返回失败;示例 Wrapper 使用 handle.failure(-1, retMsg)。
句柄类型:global.sud.op.runtime.client.SUDOPCommonStateHandle。
参数类型位于 global.sud.op.runtime.core.model。
