【问题标题】:widget not appearing小部件未出现
【发布时间】: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


【解决方案1】:

你有没有机会运行 Android 4.0.3?

该版本存在一个已知问题。见issue 24208

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-20
    • 2014-05-16
    • 2018-08-11
    • 1970-01-01
    相关资源
    最近更新 更多