【发布时间】:2012-06-24 19:22:04
【问题描述】:
我正在尝试制作一个小部件,但是当我安装我的应用程序时,它没有出现在小部件列表中,我认为这意味着我的清单文件有问题。已经为 1.5-2.2 尝试了几个不同的示例,re-honeycomb 和 post-honeycomb Widgets 的工作方式有什么不同吗?
无论如何,这是我清单的小部件部分
<!-- Broadcast Receiver that will process AppWidget updates -->
<receiver android:name=".ButtonWidget" android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<!-- Broadcast Receiver that will also process our self created action -->
<action android:name="com.dotpubs.counterpro.ButtonWidget.ACTION_WIDGET_RECEIVER"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/button_widget_provider" />
</receiver>
<!-- this activity will be called, when we fire our self created ACTION_WIDGET_CONFIGURE -->
<activity android:name=".ClickOneActivity">
<intent-filter>
<action android:name="com.dotpubs.counterpro.ACTION_WIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
【问题讨论】:
-
并非所有代码都显示,我不知道为什么,当我尝试编辑它时显示,有人可以帮忙吗?
-
在运行应用程序时注意LogCat,可能会有一条日志消息告诉你出了什么问题。
标签: android widget android-3.0-honeycomb