开发者

how to add multiple widgets?

开发者 https://www.devze.com 2023-04-05 09:42 出处:网络
I\'ve a two widgets in my android program and I implementations both of them in to the AndroidManifest but when I put this two widgets in my android screen on a same time , once of them showing me emp

I've a two widgets in my android program and I implementations both of them in to the AndroidManifest but when I put this two widgets in my android screen on a same time , once of them showing me empty and another one works normally.

This is my man开发者_开发技巧ifest , is my issue depend to my manifest?

   <receiver android:name=".MyMediumWidget" android:label="@string/medium_widget_name">
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <meta-data android:name="android.appwidget.provider"
            android:resource="@xml/medium_widget_provider" />
    </receiver>

    <receiver android:name=".MyLargeWidget" android:label="@string/large_widget_name">
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <meta-data android:name="android.appwidget.provider"
            android:resource="@xml/large_widget_provider" />
    </receiver>

Thanks


I'm offering multiple widgets in my app and my manifest declarations are exactly the same as yours, so I would say your issue may be living in your code and not in your manifest.

Hope this helps pal,

-serkan


If you are using a Service for updating them be sure both services are declared in the manifest =)

also you should check if in your real code

<receiver android:name=".MyMediumWidget" ...

and

<receiver android:name=".MyLargeWidget" ...

Have different classes. Else you'll only see one

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号