Android:在创建时配置Appwidget大小
根据文档,应该可以使用配置活动配置应用程序小部件的大小 http://developer.android.com/guide/topics/appwidgets/index .html#配置
如果您希望用户在添加新的应用程序窗口小部件时配置设置,您可以创建应用程序窗口小部件配置活动。此 Activity 将由 App Widget 主机自动启动,并允许用户在创建时配置 App Widget 的可用设置,例如 App Widget 颜色、大小、更新周期或其他功能设置。
我找不到任何有关如何执行此操作的示例,有人有任何想法吗?
谢谢!
灰
According to the documentation it should be possible to configure the size of an App Widget using a configuration activity
http://developer.android.com/guide/topics/appwidgets/index.html#Configuring
If you would like the user to configure settings when he or she adds a new App Widget, you can create an App Widget configuration Activity. This Activity will be automatically launched by the App Widget host and allows the user to configure available settings for the App Widget at create-time, such as the App Widget color, size, update period or other functionality settings.
I can't find any examples on how to do this, has anyone got any ideas?
Thanks!
Ash
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为目前这可能无法完全满足您的要求。
我认为解决方案是为不同的尺寸(4x1、3x1、4x2 等)创建单独的提供程序,但显示的内容取决于开发人员。选择小部件(大小)后,可以显示配置活动,用户可以在其中选择他想要的内容。
例如具有多个提供程序的工作清单文件的详细信息请参阅:
I think this may not be possible at the moment to do exactly what you want.
I think the solution is to create separate providers just for the different sizes (4x1, 3x1, 4x2, etc.), but the content displayed is up to the developer. After selecting the widget (size) a Configuration Activity can be shown where the user can then select what content he wants.
For an example of a working manifest file with multiple providers see: