App Widget does not appear in the widget list on Honeycomb devices until Launcher is restarted [duplicate]

瘦欲@ 提交于 2019-12-21 09:25:18

问题


Possible Duplicate:
Android AppWidget does not show up in the menu in honeycomb until reboot

It seems like the default launcher in Android 3 (Honeycomb) has a bug. It doesn't seem to refresh the widget list when you install a new application. When you restart the launcher (or restart the whole tablet) the widget will be there, as it should be. Seems like the widget list there is cached, while on earlier versions of Android, and in other launchers this is not the case.

I've followed the instructions in the SDK, and it seems to be working find on other devices, but on Android 3 it never worked right from the first time :(

I've marked my application with android:installLocation="internalOnly"
Here's the widget registration in the manifest:

    <receiver android:name=".BatteryWidget" android:label="@string/widget_name">
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <intent-filter>
            <action android:name="org.flexlabs.action.BATTERY_UPDATED" />
            <action android:name="org.flexlabs.action.dualbattery.SETTINGS_UPDATED" />
        </intent-filter>
        <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_info" />
    </receiver>

Please help?


回答1:


Honeycomb+ launcher behaves a bit differently than pre-Honeycomb one. It does not display widget in list of widgets until you launch any activity of the application.

See http://groups.google.com/group/android-developers/browse_thread/thread/6ef964dc4395e979/161a79b9a4d0a753?show_docid=161a79b9a4d0a753&pli=1 for more details.



来源:https://stackoverflow.com/questions/7736313/app-widget-does-not-appear-in-the-widget-list-on-honeycomb-devices-until-launche

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!