我在这里找到了例子:Android - Intent that open widget context menu在这里:http://coderender.blogspot.com/ .
第一个启动小部件选择器,但当您选择任何内容时它就会消失。第二个允许您选择一个小部件,但它会在应用程序 View 中显示它。有没有办法从应用程序中的按钮调用小部件选择,但仍然让手机上的主屏幕成为 AppWidgetHost?
这可能是我误解了事情,但在我看来,AppWidgetHost 必须是您调用小部件选择菜单的应用程序。
最佳答案
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?
仅当您位于主屏幕时。
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.
更重要的是,AppWidgetHost
必须完成使用选择的工作。
关于android - 从 Android 应用程序将小部件添加到主屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10449884/