diff --git a/CompleteApps/DistributedSearch/entry/src/main/java/ohos/samples/distributedsearch/utils/WidgetHelper.java b/CompleteApps/DistributedSearch/entry/src/main/java/ohos/samples/distributedsearch/utils/WidgetHelper.java index 076e9e15b428951457e46d6c62cbb24943e29855..49b289f33161656b4c9001e39c43cab41d59d827 100644 --- a/CompleteApps/DistributedSearch/entry/src/main/java/ohos/samples/distributedsearch/utils/WidgetHelper.java +++ b/CompleteApps/DistributedSearch/entry/src/main/java/ohos/samples/distributedsearch/utils/WidgetHelper.java @@ -61,6 +61,19 @@ public class WidgetHelper { * @param durationTime the duration time */ public static void showTips(Context context, String msg, int durationTime) { + context.getMainTaskDispatcher().asyncDispatch(() -> { + showTipsUi(context, msg, durationTime); + }); + } + + /** + * Show tips ui. + * + * @param context the context + * @param msg the msg + * @param durationTime the duration time + */ + public static void showTipsUi(Context context, String msg, int durationTime) { Component rootView = LayoutScatter.getInstance(context).parse(ResourceTable.Layout_widget_helper, null, false); Text text = (Text)rootView.findComponentById(ResourceTable.Id_helperText);