android - 从 Android 应用程序将小部件添加到主屏幕

标签 android

我在这里找到了例子: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/

相关文章:

java - Android StaggeredGrid中如何在Adapter中填充数据并加载到Gridview

android - 如何使用 gradle 在 APK 文件名中设置 versionName?

android - 禁用 html css 设计文本框的问题?

android - 在 doInBackground 中抛出异常并在 onPostExecute 中捕获

java - Android ListView - onItemClickListener

android - 使用 AES 的对称加密导致 cipher.init 上的 NullPointerException

android - TvInputManager.getTvInputList() 中的 NullPointerException

android - Ffmpeg Android - 将 WAV 转换为 MP3 的最小二进制大小

android - 如何根据 Android 中对服务器的异步后台调用结果返回 fragment 的 onCreateView 方法内的两个不同 View ?

java - 使用 multipart/form-data android 上传文件时出错