将代码提取到 lib 小部件后不再工作
作为我项目的一部分,我有一个完美运行的小部件。然后我决定将公共代码(包括小部件)提取到库项目中。完成此操作后,除了小部件之外,一切正常。它出现在可添加的小部件列表中,但是当我将其放在桌面上时,我得到的只是这条消息:“您的手机上未安装应用程序”。有人可以阐明这一点吗?
配置和代码都没有改变。小部件定义存在于两个元文件(项目和 lib)中,项目元文件包含绝对(包括路径)名称和所有权限。
I had a perfectly working widget as part of my project. Then I decided to extract common code (including the widget) into the library project. After doing this everything works except the widget. It appears in the list of widgets available for addition but when I place it on the desktop all I get is this toast message: "Application is not installed on your phone". Can someone shed light on this?
Neither configuration nor code has changed. Widget definition exists in both meta files (project and lib) with project metafile containing absolute (including path) names and all permissions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我今天遇到了同样的问题。不过我想我已经找到了答案。
检查 AppWidget 元数据 XML 文件中
android:configure
元素的正确性。如果您有小部件配置活动,当您将小部件提取到不同的项目时,其类名称或包可能已更改。现在系统找不到您提到的活动,并抱怨“您的手机上未安装应用程序”。
I've ran into the same problem today. However I guess I've found an answer.
Check the correctness of
android:configure
element in AppWidget metadata XML file. If you have widget configuration activity, probably its class name or package has changed when you extracted widget to different project.Now system cannot find activity that you mentioned and complains with cryptric "Application is not installed on your phone".
放入清单:
Put into manifest: