添加小部件从Android应用程序到主屏幕部件、应用程序、屏幕、Android

2023-09-06 19:24:48 作者:痞味小姐姐

我发现这里的例子:Android - 意图打开窗口小部件的上下文菜单在这里: HTTP://$c$crend​​er.blogspot。 COM / 。

第一个启动窗口小部件选择器,但进入它消失,当你选择任何内容。第二个让你选择一个小部件,但它显示了在应用程序中查看。有没有一种方法调用从一个按钮控件中选择一个应用程序,但仍然有手机的主屏幕是AppWidgetHost?

这可能是我misinter preting的事情,但在我看来像AppWidgetHost必须有你的地方调用控件选择菜单中的应用程序。

解决方案   

有没有一种方法调用从一个按钮控件中选择一个应用程序,但仍然有手机的主屏幕是AppWidgetHost?

只有当你的主屏幕。

  

这可能是我misinter preting的事情,但在我看来像AppWidgetHost必须有你的地方调用控件选择菜单中的应用程序。

更重要的是,它是 AppWidgetHost 必须做的工作,以利用选择的。

I have found examples here: Android - Intent that open widget context menu and here: http://coderender.blogspot.com/.

The first one launches the widget picker, but goes it goes away when you select anything. The second one lets you pick a widget, but it shows it in the application view. Is there a way to call the widget selection from a button in an app but still have the main screen on the phone be the AppWidgetHost?

三星S8 独立应用程序屏幕设置方法

It may be me misinterpreting things, but it looks to me like the AppWidgetHost has to be the application where you are calling the widget selection menu.

解决方案

Is there a way to call the widget selection from a button in an app but still have the main screen on the phone be the AppWidgetHost?

Only if you are the home screen.

It may be me misinterpreting things, but it looks to me like the AppWidgetHost has to be the application where you are calling the widget selection menu.

More importantly, it is the AppWidgetHost that must do the work to make use of the selection.